Methods Summary |
---|
protected void | bindConnectionFactory()Bind the connection factory into jndi
InitialContext ctx = new InitialContext();
try
{
log.debug("Binding object '" + cf + "' into JNDI at '" + bindName + "'");
Name name = ctx.getNameParser("").parse(bindName);
NonSerializableFactory.rebind(name, cf, true);
log.info("Bound ConnectionManager '" + serviceName + "' to JNDI name '" + bindName + "'");
}
catch (NamingException ne)
{
throw new DeploymentException("Could not bind ConnectionFactory into jndi: " + bindName, ne);
}
finally
{
ctx.close();
}
|
protected void | createConnectionFactory()Create the connection factory
try
{
BaseConnectionManager2 bcm = (BaseConnectionManager2) server.getAttribute(cm, "Instance");
BaseConnectionManager2.ConnectionManagerProxy cmProxy = new BaseConnectionManager2.ConnectionManagerProxy(bcm, cm);
cf = bcm.getPoolingStrategy().getManagedConnectionFactory().createConnectionFactory(cmProxy);
}
catch (ResourceException re)
{
throw new DeploymentException("Could not create ConnectionFactory for adapter: " + cm);
}
|
protected void | determineBindName()Determine the bind name
bindName = jndiName;
if( useJavaContext && jndiName.startsWith("java:") == false )
bindName = "java:" + jndiName;
|
public java.lang.String | getBindName()
return bindName;
|
public javax.management.ObjectName | getConnectionManager()
return cm;
|
public java.lang.String | getJndiName()
return jndiName;
|
public boolean | isUseJavaContext()
return useJavaContext;
|
public void | setConnectionManager(javax.management.ObjectName cm)
this.cm = cm;
|
public void | setJndiName(java.lang.String jndiName)
this.jndiName = jndiName;
|
public void | setUseJavaContext(boolean useJavaContext)
this.useJavaContext = useJavaContext;
|
protected void | startService()
determineBindName();
createConnectionFactory();
bindConnectionFactory();
|
protected void | stopService()
unbindConnectionFactory();
|
protected void | unbindConnectionFactory()Unbind the connection factory into jndi
InitialContext ctx = new InitialContext();
try
{
ctx.unbind(bindName);
NonSerializableFactory.unbind(bindName);
log.info("Unbound ConnectionManager '" + serviceName + "' from JNDI name '" + bindName + "'");
}
catch (NamingException ne)
{
log.error("Could not unbind managedConnectionFactory from jndi: " + bindName, ne);
}
finally
{
ctx.close();
}
|