Examples of SessionFactory


Examples of org.menacheri.jetclient.app.impl.SessionFactory

    LoginBuilder builder = new LoginBuilder().username("user")
        .password("pass").connectionKey("Zombie_ROOM_1_REF_KEY_1")
        .jetserverTcpHostName("localhost").tcpPort(18090)
        .jetserverUdpHostName("255.255.255.255").udpPort(18090);
    LoginHelper loginHelper = builder.build();
    SessionFactory sessionFactory = new SessionFactory(loginHelper);
    ScheduledExecutorService taskExecutor = Executors.newSingleThreadScheduledExecutor();
    for(int i = 1; i<=50; i++){
      Session session = sessionFactory.createAndConnectSession(getDefaultHandler());
      // Set the reconnect policy for reconnection.
      session.setReconnectPolicy(new ReconnectPolicy.ReconnectNTimes(2, 2000, loginHelper));
      GamePlay task = null;
      if((i % 2) == 0){
        task = new GamePlay(IAM.DEFENDER, session);
View Full Code Here

Examples of org.ow2.easybeans.container.session.SessionFactory

    protected void remove(final EasyBeansInvocationContext invocationContext) throws PoolException {
        // Gets the factory
        Factory factory = invocationContext.getFactory();

        // factory is a session factory.
        SessionFactory sessionFactory = (SessionFactory) factory;

        // get pool
        Pool<EasyBeansSB, Long> pool = sessionFactory.getPool();

        // Get the bean
        EasyBeansSB bean = (EasyBeansSB) invocationContext.getTarget();

        // discard instance
View Full Code Here

Examples of org.springframework.extensions.jcr.SessionFactory

    SecurityContextHolder.getContext().setAuthentication( auth );
  }

  public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException {
    manager = (IBackingRepositoryLifecycleManager) applicationContext.getBean( "backingRepositoryLifecycleManager" );
    SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean( "jcrSessionFactory" );
    testJcrTemplate = new JcrTemplate( jcrSessionFactory );
    testJcrTemplate.setAllowCreate( true );
    testJcrTemplate.setExposeNativeSession( true );
    repositoryAdminUsername = (String) applicationContext.getBean( "repositoryAdminUsername" );
    authenticatedRoleName = (String) applicationContext.getBean( "singleTenantAuthenticatedAuthorityName" );
View Full Code Here

Examples of org.springframework.integration.file.remote.session.SessionFactory

    File file = new File(tmpDir, "foo.txt");
    file.delete();

    ByteArrayInputStream data = new ByteArrayInputStream("foobarbaz".getBytes());
    Session session = mock(Session.class);
    SessionFactory factory = mock(SessionFactory.class);
    when(factory.getSession()).thenReturn(session);
    when(session.readRaw("foo.txt")).thenReturn(data);
    when(session.finalizeRaw()).thenReturn(true);

    StepExecution stepExecution = new StepExecution("foo", null);
    ExecutionContext stepExecutionContext = new ExecutionContext();
View Full Code Here

Examples of org.springmodules.jcr.SessionFactory

public class LocalTransactionManagerTests extends TestCase {

  public void testTransactionCommit() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
    MockControl sessionControl = MockControl.createControl(XASession.class);
    final XASession session = (XASession) sessionControl.getMock();
    // create nice mock
    MockControl xaResControl = MockControl.createControl(XAResource.class);
    XAResource xaRes = (XAResource) xaResControl.getMock();

    sfControl.expectAndReturn(sf.getSession(), session);
    sessionControl.expectAndReturn(session.getXAResource(), xaRes);

    session.save();
    session.logout();
View Full Code Here

Examples of org.springmodules.jcr.SessionFactory

    xaResControl.verify();
  }

  public void testTransactionRollback() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
    MockControl sessionControl = MockControl.createControl(XASession.class);
    final XASession session = (XASession) sessionControl.getMock();
    // create nice mock
    MockControl xaResControl = MockControl.createControl(XAResource.class);
    XAResource xaRes = (XAResource) xaResControl.getMock();

    sfControl.expectAndReturn(sf.getSession(), session);

    sessionControl.expectAndReturn(session.getXAResource(), xaRes);
    session.save();
    session.logout();
    /*
 
View Full Code Here

Examples of org.springmodules.jcr.SessionFactory

    xaResControl.verify();
  }

  public void testTransactionRollbackOnly() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
    MockControl sessionControl = MockControl.createControl(XASession.class);
    final XASession session = (XASession) sessionControl.getMock();
    // create nice mock
    MockControl xaResControl = MockControl.createControl(XAResource.class);
    XAResource xaRes = (XAResource) xaResControl.getMock();

    sfControl.expectAndReturn(sf.getSession(), session);

    sessionControl.expectAndReturn(session.getXAResource(), xaRes);
    session.save();
    session.logout();
View Full Code Here

Examples of org.springmodules.jcr.SessionFactory

    xaResControl.verify();
  }

  public void testInvalidIsolation() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();

    sfControl.replay();

    PlatformTransactionManager tm = new LocalTransactionManager(sf);
    TransactionTemplate tt = new TransactionTemplate(tm);
View Full Code Here

Examples of org.springmodules.jcr.SessionFactory

    sfControl.verify();
  }

  public void testTransactionCommitWithPrebound() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
    MockControl sessionControl = MockControl.createControl(XASession.class);
    final XASession session = (XASession) sessionControl.getMock();

    MockControl xaResControl = MockControl.createControl(XAResource.class);
    XAResource xaRes = (XAResource) xaResControl.getMock();
View Full Code Here

Examples of org.springmodules.jcr.SessionFactory

    xaResControl.verify();
  }

  public void testTransactionRollbackOnlyWithPrebound() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
    MockControl sessionControl = MockControl.createControl(XASession.class);
    final XASession session = (XASession) sessionControl.getMock();

    MockControl xaResControl = MockControl.createControl(XAResource.class);
    XAResource xaRes = (XAResource) xaResControl.getMock();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.