Class JNDIDirectConnectionFactory

java.lang.Object
oracle.soa.api.JNDIDirectConnectionFactory
All Implemented Interfaces:
DirectConnectionFactory

public class JNDIDirectConnectionFactory extends Object implements DirectConnectionFactory
Creates direct binding connections via JNDI lookups

Example

 
 DirectConnectionFactory factory = JNDIDirectConnectionFactory.newInstance();
 Map<String, Object> props = new HashMap<String, Object>();
 props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
 props.put(Context.PROVIDER_URL, "t3://" + getHost() + ':' + getPort());
 DirectConnection conn = factory.createConnection(address, props);
 
 

  • Field Details

    • BEAN_NAME_PROPERTY

      public static final String BEAN_NAME_PROPERTY
      See Also:
    • DEFAULT_MAX_CACHE_SIZE

      public static final int DEFAULT_MAX_CACHE_SIZE
      Default max size of the connection cache of 50 entries
    • SOA_DIRECTCONNECTION_CACHE_MAX_SIZE

      public static final String SOA_DIRECTCONNECTION_CACHE_MAX_SIZE
      system property name for default max cache size
      See Also:
    • DEFAULT_MAX_IDLE_TIME

      public static final long DEFAULT_MAX_IDLE_TIME
      Default idle time is 600 seconds. When all references to a connection have been closed, and if idle time is greater than the default, then it will be removed from the cache
    • SOA_DIRECTCONNECTION_CACHE_MAX_IDLE_TIME

      public static final String SOA_DIRECTCONNECTION_CACHE_MAX_IDLE_TIME
      system property name for default max idle time
      See Also:
  • Method Details

    • newInstance

      public static DirectConnectionFactory newInstance()
      Get an instance of DirectConnectionFactory with default cache configuration
      Returns:
      an instance of DirectConnectionFactory.
    • newInstance

      public static DirectConnectionFactory newInstance(int maxCacheSize, long maxIdleTime)
      Get an instance of DirectConnectionFactory with specified cache max size and max idle time
      Parameters:
      maxCacheSize - max size before the cache cleanup is triggered
      maxIdleTime - max idle time before a connection is removed from the cache when the close() is called on the connection
      Returns:
      an instance of DirectConnectionFactory
    • createConnection

      public DirectConnection createConnection(String servicePath, Map<String,Object> properties) throws Exception
      Creates a direct binding connection

      The supported properties include:

      • Any of the environment properties defined by javax.naming.Context
      • Any weblogic specific jndi properties in packages weblogic.rmi & weblogic.jndi
      • Any websphere specific jndi properties in package com.ibm.websphere.naming
      • BEAN_NAME_PROPERTY - Used to override the default JNDI lookup name

      Specified by:
      createConnection in interface DirectConnectionFactory
      Parameters:
      servicePath - the service path, patterned after /<domain name>/<composite name>/<revision>/<service name> Note that if no domain name is explicitly configured for the composite, then the default value is default.
      properties - JNDI connection properties
      Returns:
      a direct binding connection
      Throws:
      Exception