| Method from org.jboss.resource.adapter.jms.JmsManagedConnectionFactory Detail: |
public Object createConnectionFactory() throws ResourceException {
return createConnectionFactory(null);
}
Create a "non managed" connection factory. No appserver involved |
public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException {
Object cf = new JmsConnectionFactoryImpl(this, cxManager);
if (log.isTraceEnabled())
{
log.trace("Created connection factory: " + cf + ", using connection manager: " + cxManager);
}
return cf;
}
Create a ConnectionFactory with appserver hook |
public ManagedConnection createManagedConnection(Subject subject,
ConnectionRequestInfo info) throws ResourceException {
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;
}
Create a new connection to manage in pool |
public boolean equals(Object obj) {
if (obj == null)
return false;
if (obj instanceof JmsManagedConnectionFactory)
{
return mcfProperties.equals(((JmsManagedConnectionFactory) obj).getProperties());
}
else
{
return false;
}
}
Checks for equality ower the configured properties. |
public String getClientID() {
return mcfProperties.getClientID();
}
Get client id, may be null. |
public JMSProviderAdapter getJmsProviderAdapter() {
return adapter;
}
|
public String getJmsProviderAdapterJNDI() {
return mcfProperties.getProviderJNDI();
}
|
public PrintWriter getLogWriter() throws ResourceException {
//
// jason: screw the logWriter stuff for now it sucks ass
//
return null;
}
|
public ConnectionMetaData getMetaData() {
return new JmsConnectionMetaData();
}
|
public String getPassword() {
return mcfProperties.getPassword();
}
Get password, may be null. |
protected JmsMCFProperties getProperties() {
return mcfProperties;
}
|
public String getSessionDefaultType() {
return mcfProperties.getSessionDefaultType();
}
|
public int getUseTryLock() {
return useTryLock;
}
|
public String getUserName() {
return mcfProperties.getUserName();
}
Get userName, may be null. |
public int hashCode() {
return mcfProperties.hashCode();
}
|
public boolean isStrict() {
return strict;
}
|
public ManagedConnection matchManagedConnections(Set connectionSet,
Subject subject,
ConnectionRequestInfo info) throws ResourceException {
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;
}
Match a set of connections from the pool |
public void setClientID(String clientID) {
mcfProperties.setClientID(clientID);
}
Set client id, null by default. |
public void setJmsProviderAdapter(JMSProviderAdapter adapter) {
this.adapter = adapter;
}
|
public void setJmsProviderAdapterJNDI(String jndi) {
mcfProperties.setProviderJNDI(jndi);
}
|
public void setLogWriter(PrintWriter out) throws ResourceException {
//
// jason: screw the logWriter stuff for now it sucks ass
//
}
|
public void setPassword(String password) {
mcfProperties.setPassword(password);
}
Set password, null by default. |
public void setSessionDefaultType(String type) throws ResourceException {
mcfProperties.setSessionDefaultType(type);
}
Set the default session typ |
public void setStrict(boolean strict) {
this.strict = strict;
}
|
public void setStrict(Boolean strict) {
this.strict = strict.booleanValue();
}
|
public void setUseTryLock(int useTryLock) {
this.useTryLock = useTryLock;
}
|
public void setUserName(String userName) {
mcfProperties.setUserName(userName);
}
Set userName, null by default. |