@Test public void getObjectInstance_ISessionPool() throws Exception { String className = ISessionPool.class.getName(); String factoryName = ArcSDEConnectionFactory.class.getName(); String factoryLocation = null; Reference ref = createRef(className, factoryName, factoryLocation); Name name = null; Context nameCtx = null; Hashtable<?, ?> environment = null; Object object = factory.getObjectInstance(ref, name, nameCtx, environment); assertNotNull(object); assertTrue(object instanceof SharedSessionPool); ArcSDEConnectionConfig config = ((SharedSessionPool) object).getConfig(); assertNotNull(config); assertEquals("localhost", config.getServerName()); Reference ref2 = createRef(className, factoryName, factoryLocation); Object object2 = factory.getObjectInstance(ref2, name, nameCtx, environment); assertSame(object, object2); }
public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment) throws Exception { final Reference ref = (Reference) obj; LOGGER.info("ArcSDEConnectionFactory: ref is " + ref); final String className = ref.getClassName(); LOGGER.info("ArcSDEConnectionFactory: className is " + className); checkAlternateSessionPoolFactory(ref); Object dereferencedObject = null; if (ISessionPool.class.getName().equals(className)) { ArcSDEConnectionConfig config = createConfig(ref); LOGGER.info("ArcSDEConnectionFactory: config is " + config); ISessionPool sharedPool = getSharedPool(config); LOGGER.info("ArcSDEConnectionFactory: shared pool is " + sharedPool); dereferencedObject = sharedPool; } else { LOGGER.info("ArcSDEConnectionFactory: not a config"); } return dereferencedObject; }
ArcSDEConnectionFactory implements ObjectFactory { public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment) throws Exception { final Reference ref = (Reference) obj; LOGGER.info("ArcSDEConnectionFactory: ref is " + ref); final String className = ref.getClassName(); LOGGER.info("ArcSDEConnectionFactory: className is " + className); checkAlternateSessionPoolFactory(ref); Object dereferencedObject = null; if (ISessionPool.class.getName().equals(className)) { ArcSDEConnectionConfig config = createConfig(ref); LOGGER.info("ArcSDEConnectionFactory: config is " + config); ISessionPool sharedPool = getSharedPool(config); LOGGER.info("ArcSDEConnectionFactory: shared pool is " + sharedPool); dereferencedObject = sharedPool; } else { LOGGER.info("ArcSDEConnectionFactory: not a config"); } return dereferencedObject; } }
ArcSDEConnectionFactory implements ObjectFactory { public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment) throws Exception { final Reference ref = (Reference) obj; LOGGER.info("ArcSDEConnectionFactory: ref is " + ref); final String className = ref.getClassName(); LOGGER.info("ArcSDEConnectionFactory: className is " + className); checkAlternateSessionPoolFactory(ref); Object dereferencedObject = null; if (ISessionPool.class.getName().equals(className)) { ArcSDEConnectionConfig config = createConfig(ref); LOGGER.info("ArcSDEConnectionFactory: config is " + config); ISessionPool sharedPool = getSharedPool(config); LOGGER.info("ArcSDEConnectionFactory: shared pool is " + sharedPool); dereferencedObject = sharedPool; } else { LOGGER.info("ArcSDEConnectionFactory: not a config"); } return dereferencedObject; }  }
ArcSDEConnectionFactory implements ObjectFactory { public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment) throws Exception { final Reference ref = (Reference) obj; LOGGER.info("ArcSDEConnectionFactory: ref is " + ref); final String className = ref.getClassName(); LOGGER.info("ArcSDEConnectionFactory: className is " + className); checkAlternateSessionPoolFactory(ref); Object dereferencedObject = null; if (ISessionPool.class.getName().equals(className)) { ArcSDEConnectionConfig config = createConfig(ref); LOGGER.info("ArcSDEConnectionFactory: config is " + config); ISessionPool sharedPool = getSharedPool(config); LOGGER.info("ArcSDEConnectionFactory: shared pool is " + sharedPool); dereferencedObject = sharedPool; } else { LOGGER.info("ArcSDEConnectionFactory: not a config"); } return dereferencedObject; }  Object getObjectInstance(final Object obj, final Name name, final Context nameCtx,
            final Hashtable<?, ?> environment); ISessionPool getInstance(Map<String, Serializable> properties); ISessionPool getInstance(ArcSDEConnectionConfig config); void setClosableSessionPoolFactory(final ISessionPoolFactory newFactory); }
ArcSDEConnectionFactory implements ObjectFactory { public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment) throws Exception { final Reference ref = (Reference) obj; LOGGER.info("ArcSDEConnectionFactory: ref is " + ref); final String className = ref.getClassName(); LOGGER.info("ArcSDEConnectionFactory: className is " + className); checkAlternateSessionPoolFactory(ref); Object dereferencedObject = null; if (ISessionPool.class.getName().equals(className)) { ArcSDEConnectionConfig config = createConfig(ref); LOGGER.info("ArcSDEConnectionFactory: config is " + config); ISessionPool sharedPool = getSharedPool(config); LOGGER.info("ArcSDEConnectionFactory: shared pool is " + sharedPool); dereferencedObject = sharedPool; } else { LOGGER.info("ArcSDEConnectionFactory: not a config"); } return dereferencedObject; }  Object getObjectInstance(final Object obj, final Name name, final Context nameCtx,
            final Hashtable<?, ?> environment); ISessionPool getInstance(Map<String, Serializable> properties); ISessionPool getInstance(ArcSDEConnectionConfig config); void setClosableSessionPoolFactory(final ISessionPoolFactory newFactory);  }