@Test public void getObjectInstance_MandatoryParams() throws Exception { String className = ISessionPool.class.getName(); String factoryName = ArcSDEConnectionFactory.class.getName(); String factoryLocation = null; Reference ref = new Reference(className, factoryName, factoryLocation); Name name = null; Context nameCtx = null; Hashtable<?, ?> environment = null; assertMandatory(ref, name, nameCtx, environment); ref.add(new StringRefAddr(ArcSDEConnectionConfig.SERVER_NAME_PARAM_NAME, "localhost")); assertMandatory(ref, name, nameCtx, environment); ref.add(new StringRefAddr(ArcSDEConnectionConfig.PORT_NUMBER_PARAM_NAME, "5151")); assertMandatory(ref, name, nameCtx, environment); ref.add(new StringRefAddr(ArcSDEConnectionConfig.USER_NAME_PARAM_NAME, "me")); assertMandatory(ref, name, nameCtx, environment); ref.add(new StringRefAddr(ArcSDEConnectionConfig.PASSWORD_PARAM_NAME, "mine")); Object object = factory.getObjectInstance(ref, name, nameCtx, environment); assertNotNull("We're done with mandatory params, should have worked!", object); }
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);  }