Refine search
@Override public Reference getReference() { return new Reference(Ehcache3XAResourceProducer.class.getName(), new StringRefAddr("uniqueName", getUniqueName()), ResourceObjectFactory.class.getName(), null); }
@Override public Reference getReference() { // from javax.naming.Referenceable LOG.debug( "Returning a Reference to the SessionFactory" ); return new Reference( SessionFactoryImpl.class.getName(), new StringRefAddr("uuid", getUuid()), SessionFactoryRegistry.ObjectFactoryImpl.class.getName(), null ); }
public Reference getReference() throws NamingException { final String className = getClass().getName(); final String factoryName = className + "Factory"; // XXX: not robust Reference ref = new Reference(className, factoryName, null); ref.add(new StringRefAddr("instanceKey", instanceKey)); ref.add(new StringRefAddr("url", this.getUrl())); ref.add(new StringRefAddr("username", this.getUsername())); ref.add(new StringRefAddr("password", this.getPassword())); // TODO ADD OTHER PROPERTIES return ref; }
/** * Create a Reference instance from a JNDIStorable object * * @param instanceClassName * The name of the class that is being created. * @param po * The properties object to use when configuring the new instance. * * @return Reference * * @throws NamingException if an error occurs while creating the new instance. */ public static Reference createReference(String instanceClassName, JNDIStorable po) throws NamingException { Reference result = new Reference(instanceClassName, JNDIReferenceFactory.class.getName(), null); try { Properties props = po.getProperties(); for (Enumeration iter = props.propertyNames(); iter.hasMoreElements();) { String key = (String)iter.nextElement(); result.add(new StringRefAddr(key, props.getProperty(key))); } } catch (Exception e) { throw new NamingException(e.getMessage()); } return result; }
public Reference getReference() throws NamingException { final String className = getClass().getName(); final String factoryName = className + "Factory"; // XXX: not robust Reference ref = new Reference(className, factoryName, null); ref.add(new StringRefAddr("instanceKey", instanceKey)); ref.add(new StringRefAddr("url", this.getUrl())); ref.add(new StringRefAddr("username", this.getUsername())); ref.add(new StringRefAddr("password", this.getPassword())); // TODO ADD OTHER PROPERTIES return ref; }
/** * Create a Reference instance from a JNDIStorable object * * @param instanceClassName * @param po * @return * @throws NamingException */ public static Reference createReference(String instanceClassName, JNDIStorableInterface po) throws NamingException { if (log.isTraceEnabled()) { log.trace("Creating reference: " + instanceClassName + "," + po); } Reference result = new Reference(instanceClassName, JNDIReferenceFactory.class.getName(), null); try { Properties props = po.getProperties(); for (Enumeration iter = props.propertyNames(); iter.hasMoreElements();) { String key = (String)iter.nextElement(); String value = props.getProperty(key); javax.naming.StringRefAddr addr = new javax.naming.StringRefAddr(key, value); result.add(addr); } } catch (Exception e) { log.error(e.getMessage(), e); throw new NamingException(e.getMessage()); } return result; }
/** * Get a new reference for this object, using the current settings. * * @return the new reference */ @Override public Reference getReference() { debugCodeCall("getReference"); String factoryClassName = JdbcDataSourceFactory.class.getName(); Reference ref = new Reference(getClass().getName(), factoryClassName, null); ref.add(new StringRefAddr("url", url)); ref.add(new StringRefAddr("user", userName)); ref.add(new StringRefAddr("password", convertToString(passwordChars))); ref.add(new StringRefAddr("loginTimeout", String.valueOf(loginTimeout))); ref.add(new StringRefAddr("description", description)); return ref; }
/** * @param on ObjectName instance to work with. * @return A simple reference based on passed <code>on</code> */ public static Reference getReference(final ObjectName on) { Reference r = new Reference(String.class.getName()); Hashtable<String,String> ht = on.getKeyPropertyList(); r.add(new StringRefAddr("host", (String)ht.get("host"))); r.add(new StringRefAddr("name", (String)ht.get("name"))); // Put in a value to serve as a unique 'key'. r.add(new StringRefAddr("key", on.getCanonicalKeyPropertyListString())); return r; }
/** * Get a new reference for this object, using the current settings. * * @return the new reference */ @Override public Reference getReference() { debugCodeCall("getReference"); String factoryClassName = JdbcDataSourceFactory.class.getName(); Reference ref = new Reference(getClass().getName(), factoryClassName, null); ref.add(new StringRefAddr("url", url)); ref.add(new StringRefAddr("user", userName)); ref.add(new StringRefAddr("password", convertToString(passwordChars))); ref.add(new StringRefAddr("loginTimeout", String.valueOf(loginTimeout))); ref.add(new StringRefAddr("description", description)); return ref; }
@Override public Reference getReference() throws NamingException { final Reference reference = new Reference(getClass().getName(), P6DataSourceFactory.class.getName(), null); reference.add(new StringRefAddr("dataSourceName", getRealDataSource())); return reference; }
public Reference getReference() throws NamingException { final String className = getClass().getName(); final String factoryName = className + "Factory"; // XXX: not robust Reference ref = new Reference(className, factoryName, null); ref.add(new StringRefAddr("instanceKey", instanceKey)); ref.add(new StringRefAddr("url", this.getUrl())); ref.add(new StringRefAddr("username", this.getUsername())); ref.add(new StringRefAddr("password", this.getPassword())); // TODO ADD OTHER PROPERTIES return ref; }
@Test public void getObjectInstance() throws Exception { Reference resource = new Reference("CassandraClientFactory"); resource.add(new StringRefAddr("hosts", cassandraUrl)); resource.add(new StringRefAddr("clusterName", clusterName)); resource.add(new StringRefAddr("keyspace", "Keyspace1")); resource.add(new StringRefAddr("autoDiscoverHosts", "true")); Name jndiName = mock(Name.class); Context context = new InitialContext(); Hashtable<String, String> environment = new Hashtable<String, String>(); Keyspace keyspace = (Keyspace) factory.getObjectInstance(resource, jndiName, context, environment); assertNotNull(keyspace); assertEquals("Keyspace1",keyspace.getKeyspaceName()); } }
public Reference getReference() throws NamingException { return new Reference( BitronixTransactionManager.class.getName(), new StringRefAddr("TransactionSynchronizationRegistry", "BitronixTransactionSynchronizationRegistry"), BitronixTransactionSynchronizationRegistryObjectFactory.class.getName(), null ); }
/** * @see javax.naming.Referenceable#getReference() */ public Reference getReference() throws NamingException { return new Reference( SessionFactoryStub.class.getName(), new StringRefAddr("uuid", uuid), SessionFactoryObjectFactory.class.getName(), null ); }
/** * @see javax.naming.Referenceable#getReference() */ public Reference getReference() throws NamingException { return new Reference( SessionFactoryStub.class.getName(), new StringRefAddr("uuid", uuid), SessionFactoryObjectFactory.class.getName(), null ); }
/** * @see javax.naming.Referenceable#getReference() */ @Override public Reference getReference() throws NamingException { return new Reference( SessionFactoryStub.class.getName(), new StringRefAddr("uuid", uuid), SessionFactoryRegistry.ObjectFactoryImpl.class.getName(), null ); }
@Override public Reference getReference() throws NamingException { return new Reference( BitronixTransactionManager.class.getName(), new StringRefAddr("TransactionSynchronizationRegistry", "BitronixTransactionSynchronizationRegistry"), BitronixTransactionSynchronizationRegistryObjectFactory.class.getName(), null ); }
@Override public Reference getReference() throws NamingException { return new Reference( BitronixTransactionManager.class.getName(), new StringRefAddr("TransactionSynchronizationRegistry", "BitronixTransactionSynchronizationRegistry"), BitronixTransactionSynchronizationRegistryObjectFactory.class.getName(), null ); }
/** * @see javax.naming.Referenceable#getReference() */ public Reference getReference () throws NamingException { return new Reference ( getClass ().getName (), new StringRefAddr ( "name", "TransactionManager" ), TransactionManagerFactory.class .getName (), null ); }
/** * {@inheritDoc} */ @Override public Reference getReference() throws NamingException { return new Reference(EhCacheXAResourceProducer.class.getName(), new StringRefAddr("uniqueName", getUniqueName()), ResourceObjectFactory.class.getName(), null); }