Methods Summary |
---|
public java.lang.Object | createConnectionFactory()Create a "non managed" connection factory. No appserver involved
return createConnectionFactory(null);
|
public java.lang.Object | createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)Create a ConnectionFactory with appserver hook
Object cf = new JmsConnectionFactoryImpl(this, cxManager);
if (log.isTraceEnabled())
{
log.trace("Created connection factory: " + cf + ", using connection manager: " + cxManager);
}
return cf;
|
public javax.resource.spi.ManagedConnection | createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)Create a new connection to manage in pool
boolean trace = log.isTraceEnabled();
info = getInfo(info);
if (trace)
log.trace("connection request info: " + info);
JmsCred cred = JmsCred.getJmsCred(this, subject, info);
if (trace)
log.trace("jms credentials: " + cred);
// OK we got autentication stuff
JmsManagedConnection mc = new JmsManagedConnection(this, info, cred.name, cred.pwd);
if (trace)
log.trace("created new managed connection: " + mc);
return mc;
|
public boolean | equals(java.lang.Object obj)Checks for equality ower the configured properties.
if (obj == null)
return false;
if (obj instanceof JmsManagedConnectionFactory)
{
return mcfProperties.equals(((JmsManagedConnectionFactory) obj).getProperties());
}
else
{
return false;
}
|
public java.lang.String | getClientID()Get client id, may be null.
return mcfProperties.getClientID();
|
private javax.resource.spi.ConnectionRequestInfo | getInfo(javax.resource.spi.ConnectionRequestInfo info)
if (info == null)
{
// Create a default one
return new JmsConnectionRequestInfo(mcfProperties);
}
else
{
// Fill the one with any defaults
((JmsConnectionRequestInfo) info).setDefaults(mcfProperties);
return info;
}
|
public org.jboss.jms.jndi.JMSProviderAdapter | getJmsProviderAdapter()
return adapter;
|
public java.lang.String | getJmsProviderAdapterJNDI()
return mcfProperties.getProviderJNDI();
|
public java.io.PrintWriter | getLogWriter()
//
// jason: screw the logWriter stuff for now it sucks ass
//
return null;
|
public javax.jms.ConnectionMetaData | getMetaData()
return new JmsConnectionMetaData();
|
public java.lang.String | getPassword()Get password, may be null.
return mcfProperties.getPassword();
|
protected JmsMCFProperties | getProperties()
return mcfProperties;
|
public java.lang.String | getSessionDefaultType()
return mcfProperties.getSessionDefaultType();
|
public java.lang.String | getUserName()Get userName, may be null.
return mcfProperties.getUserName();
|
public int | hashCode()
return mcfProperties.hashCode();
|
public boolean | isStrict()
return strict;
|
public javax.resource.spi.ManagedConnection | matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)Match a set of connections from the pool
boolean trace = log.isTraceEnabled();
// Get cred
info = getInfo(info);
JmsCred cred = JmsCred.getJmsCred(this, subject, info);
if (trace)
log.trace("Looking for connection matching credentials: " + cred);
// Traverse the pooled connections and look for a match, return first
// found
Iterator connections = connectionSet.iterator();
while (connections.hasNext())
{
Object obj = connections.next();
// We only care for connections of our own type
if (obj instanceof JmsManagedConnection)
{
// This is one from the pool
JmsManagedConnection mc = (JmsManagedConnection) obj;
// Check if we even created this on
ManagedConnectionFactory mcf = mc.getManagedConnectionFactory();
// Only admit a connection if it has the same username as our
// asked for creds
// FIXME, Here we have a problem, jms connection
// may be anonymous, have a user name
if ((mc.getUserName() == null || (mc.getUserName() != null && mc.getUserName().equals(cred.name)))
&& mcf.equals(this))
{
// Now check if ConnectionInfo equals
if (info.equals(mc.getInfo()))
{
if (trace)
log.trace("Found matching connection: " + mc);
return mc;
}
}
}
}
if (trace)
log.trace("No matching connection was found");
return null;
|
public void | setClientID(java.lang.String clientID)Set client id, null by default.
mcfProperties.setClientID(clientID);
|
public void | setJmsProviderAdapter(org.jboss.jms.jndi.JMSProviderAdapter adapter)For local access
this.adapter = adapter;
|
public void | setJmsProviderAdapterJNDI(java.lang.String jndi)
mcfProperties.setProviderJNDI(jndi);
|
public void | setLogWriter(java.io.PrintWriter out)
//
// jason: screw the logWriter stuff for now it sucks ass
//
|
public void | setPassword(java.lang.String password)Set password, null by default.
mcfProperties.setPassword(password);
|
public void | setSessionDefaultType(java.lang.String type)Set the default session typ
mcfProperties.setSessionDefaultType(type);
|
public void | setStrict(boolean strict)
this.strict = strict;
|
public void | setStrict(java.lang.Boolean strict)
this.strict = strict.booleanValue();
|
public void | setUserName(java.lang.String userName)Set userName, null by default.
mcfProperties.setUserName(userName);
|