Package oracle.soa.api
Class JNDIDirectConnectionFactory
java.lang.Object
oracle.soa.api.JNDIDirectConnectionFactory
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intDefault max size of the connection cache of 50 entriesstatic final longDefault idle time is 600 seconds.static final Stringsystem property name for default max idle timestatic final Stringsystem property name for default max cache size -
Method Summary
Modifier and TypeMethodDescriptioncreateConnection(String servicePath, Map<String, Object> properties) Creates a direct binding connectionstatic DirectConnectionFactoryGet an instance of DirectConnectionFactory with default cache configurationstatic DirectConnectionFactorynewInstance(int maxCacheSize, long maxIdleTime) Get an instance of DirectConnectionFactory with specified cache max size and max idle time
-
Field Details
-
BEAN_NAME_PROPERTY
- See Also:
-
DEFAULT_MAX_CACHE_SIZE
public static final int DEFAULT_MAX_CACHE_SIZEDefault max size of the connection cache of 50 entries -
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_TIMEDefault 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
system property name for default max idle time- See Also:
-
-
Method Details
-
newInstance
Get an instance of DirectConnectionFactory with default cache configuration- Returns:
- an instance of DirectConnectionFactory.
-
newInstance
Get an instance of DirectConnectionFactory with specified cache max size and max idle time- Parameters:
maxCacheSize- max size before the cache cleanup is triggeredmaxIdleTime- 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 ExceptionCreates a direct binding connectionThe 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:
createConnectionin interfaceDirectConnectionFactory- 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
- Any of the environment properties defined by
-