org.jboss.resource.connectionmanager
Class RARDeployment

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.resource.connectionmanager.RARDeployment
All Implemented Interfaces:
ManagedConnectionFactory (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , java.io.Serializable, Service (src) , ServiceMBean (src)

public class RARDeployment
extends ServiceMBeanSupport (src)
implements ManagedConnectionFactory (src)

The RARDeployment mbean manages instantiation and configuration of a ManagedConnectionFactory instance. It is intended to be configured primarily by xslt transformation of the ra.xml from a jca adapter. Until that is implemented, it uses the old RARDeployment and RARDeployer mechanism to obtain information from the ra.xml. Properties for the ManagedConectionFactory should be supplied with their values in the ManagedConnectionFactoryProperties element.

See Also:
Serialized Form

Field Summary
static java.lang.String MCF_ATTRIBUTE_CHANGED_NOTIFICATION
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
RARDeployment()
          Default managed constructor for RARDeployment mbeans.
 
Method Summary
 java.lang.Object createConnectionFactory()
          Creates a connection factory instance.
 java.lang.Object createConnectionFactory(ConnectionManager (src)  cxManager)
          Creates a connection factory instance.
 ManagedConnection (src) createManagedConnection(javax.security.auth.Subject subject, ConnectionRequestInfo (src)  cxRequestInfo)
          Creates a new ManagedConnection
 boolean equals(java.lang.Object other)
          Tests object for equality
 java.lang.String getAuthenticationMechanismType()
          The AuthenticationMechanismType attribute holds the AuthenticationMechanismType from the ra.xml.
 java.lang.String getConnectionDefinition()
          The connection definition inside the rar, it identifies the unique connection factory
 java.lang.String getConnectionFactoryImplClass()
          The ConnectionFactoryImplClass attribute holds the ConnectionFactoryImplClass from the ra.xml.
 java.lang.String getConnectionFactoryInterface()
          The ConnectionFactoryInterface attribute holds the ConnectionFactoryInterface from the ra.xml.
 java.lang.String getConnectionImplClass()
          The ConnectionImplClass attribute holds the ConnectionImplClass from the ra.xml.
 java.lang.String getConnectionInterface()
          The ConnectionInterface attribute holds the ConnectionInterface from the ra.xml.
 java.lang.String getCredentialInterface()
          The CredentialInterface attribute holds the CredentialInterface from the ra.xml.
 java.lang.String getEisType()
          The EisType attribute holds the EisType from the ra.xml.
 java.io.PrintWriter getLogWriter()
          Gets the logwriter for this instance.
 java.lang.Object getManagedConnectionFactoryAttribute(java.lang.String name)
          The getManagedConnectionFactoryAttribute method can be used to examine the managed connection factory properties.
 java.lang.String getManagedConnectionFactoryClass()
          The ManagedConnectionFactoryClass attribute holds the ManagedConnectionFactoryClass from the ra.xml.
 org.w3c.dom.Element getManagedConnectionFactoryProperties()
          The ManagedConnectionFactoryProperties attribute holds the ManagedConnectionFactoryProperties from the ra.xml, together with user supplied values for all or some of these properties.
 ManagedConnectionFactory (src) getMcfInstance()
          The getMcfInstance method returns the ManagedConnectionFactory instance represented by this mbean.
 ObjectName (src) getOldRarDeployment()
          The OldRarDeployment attribute refers to a previous-generation RARDeployment.
 java.lang.String getRARName()
          The RARName attribute holds the file name of the rar
 java.lang.String getSpecVersion()
          The SpecVersion attribute holds the SpecVersion from the ra.xml It should be supplied by xslt from ra.xml
 java.lang.String getTransactionSupport()
          The TransactionSupport attribute holds the TransactionSupport from the ra.xml.
 java.lang.String getVendorName()
          The VendorName attribute holds the VendorName from the ra.xml It should be supplied by xslt from ra.xml
 java.lang.String getVersion()
          The Version attribute holds the Version from the ra.xml.
 int hashCode()
          Generates a hashCode for this object
 boolean isReauthenticationSupport()
          The ReauthenticationSupport attribute holds the ReauthenticationSupport from the ra.xml.
 ManagedConnection (src) matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, ConnectionRequestInfo (src)  cxRequestInfo)
          Returns a matching connection from the set.
 void setAuthenticationMechanismType(java.lang.String authenticationMechanismType)
          Set the AuthenticationMechanismType value.
 void setConnectionDefinition(java.lang.String connectionDefinition)
          Set the connection definition.
 void setConnectionFactoryImplClass(java.lang.String connectionFactoryImplClass)
          Set the ConnectionFactoryImplClass value.
 void setConnectionFactoryInterface(java.lang.String connectionFactoryInterface)
          Set the ConnectionFactoryInterface value.
 void setConnectionImplClass(java.lang.String connectionImplClass)
          Set the ConnectionImplClass value.
 void setConnectionInterface(java.lang.String connectionInterface)
          Set the ConnectionInterface value.
 void setCredentialInterface(java.lang.String credentialInterface)
          Set the CredentialInterface value.
 void setEisType(java.lang.String eisType)
          Set the EisType value.
 void setLogWriter(java.io.PrintWriter out)
          Sets the logwriter for this instance.
 void setManagedConnectionFactoryAttribute(java.lang.String name, java.lang.Class clazz, java.lang.Object value)
          The setManagedConnectionFactoryAttribute method can be used to set attributes on the ManagedConnectionFactory from code, without using the xml configuration.
protected  void setManagedConnectionFactoryAttribute(java.lang.String name, java.lang.Class clazz, java.lang.Object value, boolean mustExist)
           
 void setManagedConnectionFactoryClass(java.lang.String managedConnectionFactoryClass)
          Set the ManagedConnectionFactoryClass value.
 void setManagedConnectionFactoryProperties(org.w3c.dom.Element managedConnectionFactoryProperties)
          Set the ManagedConnectionFactoryProperties value.
protected  void setMcfProperties(java.util.Collection properties, boolean mustExist)
           
protected  void setMcfProperties(org.w3c.dom.Element mcfProps)
           
 void setOldRarDeployment(ObjectName (src)  oldRarDeployment)
          Set the value of OldRarDeployment
 void setRARName(java.lang.String rarName)
          Set the RARName value.
 void setReauthenticationSupport(boolean reauthenticationSupport)
          Set the ReauthenticationSupport value.
 void setSpecVersion(java.lang.String specVersion)
          Set the SpecVersion value.
 void setTransactionSupport(java.lang.String transactionSupport)
          Set the TransactionSupport value.
 void setVendorName(java.lang.String vendorName)
          Set the VendorName value.
 void setVersion(java.lang.String version)
          Set the Version value.
protected  void startService()
          Describe startManagedConnectionFactory method here.
protected  void stopService()
          The stopManagedConnectionFactory method unbinds the ConnectionFactory from jndi, releases the ManagedConnectionFactory instane, and releases the ManagedConnectionFactory class.
 java.lang.String toString()
          Override toString() so we don't fall fowl an NPE in hashCode
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MCF_ATTRIBUTE_CHANGED_NOTIFICATION

public static final java.lang.String MCF_ATTRIBUTE_CHANGED_NOTIFICATION
See Also:
Constant Field Values (src)
Constructor Detail

RARDeployment

public RARDeployment()
Default managed constructor for RARDeployment mbeans.

Method Detail

getOldRarDeployment

public ObjectName (src)  getOldRarDeployment()
The OldRarDeployment attribute refers to a previous-generation RARDeployment. THIS IS A HACK UNTIL XSLT DEPLOYMENT IS WRITTEN

Returns:
value of OldRarDeployment

setOldRarDeployment

public void setOldRarDeployment(ObjectName (src)  oldRarDeployment)
Set the value of OldRarDeployment

Parameters:
oldRarDeployment - - Value to assign to OldRarDeployment

getRARName

public java.lang.String getRARName()
The RARName attribute holds the file name of the rar

Returns:
the rar name value.

setRARName

public void setRARName(java.lang.String rarName)
Set the RARName value.

Parameters:
rarName - The new DisplayName value.

getConnectionDefinition

public java.lang.String getConnectionDefinition()
The connection definition inside the rar, it identifies the unique connection factory

Returns:
the rar name value.

setConnectionDefinition

public void setConnectionDefinition(java.lang.String connectionDefinition)
Set the connection definition.

Parameters:
connectionDefinition - - the connection definition

getVendorName

public java.lang.String getVendorName()
The VendorName attribute holds the VendorName from the ra.xml It should be supplied by xslt from ra.xml

Returns:
the VendorName value.

setVendorName

public void setVendorName(java.lang.String vendorName)
Set the VendorName value.

Parameters:
vendorName - The new VendorName value.

getSpecVersion

public java.lang.String getSpecVersion()
The SpecVersion attribute holds the SpecVersion from the ra.xml It should be supplied by xslt from ra.xml

Returns:
the SpecVersion value.

setSpecVersion

public void setSpecVersion(java.lang.String specVersion)
Set the SpecVersion value.

Parameters:
specVersion - The new SpecVersion value.

getEisType

public java.lang.String getEisType()
The EisType attribute holds the EisType from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the EisType value.

setEisType

public void setEisType(java.lang.String eisType)
Set the EisType value.

Parameters:
eisType - The new EisType value.

getVersion

public java.lang.String getVersion()
The Version attribute holds the Version from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the Version value.

setVersion

public void setVersion(java.lang.String version)
Set the Version value.

Parameters:
version - The new Version value.

getManagedConnectionFactoryClass

public java.lang.String getManagedConnectionFactoryClass()
The ManagedConnectionFactoryClass attribute holds the ManagedConnectionFactoryClass from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the ManagedConnectionFactoryClass value.

setManagedConnectionFactoryClass

public void setManagedConnectionFactoryClass(java.lang.String managedConnectionFactoryClass)
Set the ManagedConnectionFactoryClass value.

Parameters:
managedConnectionFactoryClass - The new ManagedConnectionFactoryClass value.

getConnectionFactoryInterface

public java.lang.String getConnectionFactoryInterface()
The ConnectionFactoryInterface attribute holds the ConnectionFactoryInterface from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the ConnectionFactoryInterface value.

setConnectionFactoryInterface

public void setConnectionFactoryInterface(java.lang.String connectionFactoryInterface)
Set the ConnectionFactoryInterface value.

Parameters:
connectionFactoryInterface - The ConnectionFactoryInterface value.

getConnectionFactoryImplClass

public java.lang.String getConnectionFactoryImplClass()
The ConnectionFactoryImplClass attribute holds the ConnectionFactoryImplClass from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the ConnectionFactoryImplClass value.

setConnectionFactoryImplClass

public void setConnectionFactoryImplClass(java.lang.String connectionFactoryImplClass)
Set the ConnectionFactoryImplClass value.

Parameters:
connectionFactoryImplClass - The ConnectionFactoryImplClass value.

getConnectionInterface

public java.lang.String getConnectionInterface()
The ConnectionInterface attribute holds the ConnectionInterface from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the ConnectionInterface value.

setConnectionInterface

public void setConnectionInterface(java.lang.String connectionInterface)
Set the ConnectionInterface value.

Parameters:
connectionInterface - The ConnectionInterface value.

getConnectionImplClass

public java.lang.String getConnectionImplClass()
The ConnectionImplClass attribute holds the ConnectionImplClass from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the connectionImplClass value.

setConnectionImplClass

public void setConnectionImplClass(java.lang.String connectionImplClass)
Set the ConnectionImplClass value.

Parameters:
connectionImplClass - The ConnectionImplClass value.

getTransactionSupport

public java.lang.String getTransactionSupport()
The TransactionSupport attribute holds the TransactionSupport from the ra.xml. It should be supplied by xslt from ra.xml It is ignored, and choice of ConnectionManager implementations determine transaction support. Get the TransactionSupport value.

Returns:
the TransactionSupport value.

setTransactionSupport

public void setTransactionSupport(java.lang.String transactionSupport)
Set the TransactionSupport value.

Parameters:
transactionSupport - The TransactionSupport value.

getManagedConnectionFactoryProperties

public org.w3c.dom.Element getManagedConnectionFactoryProperties()
The ManagedConnectionFactoryProperties attribute holds the ManagedConnectionFactoryProperties from the ra.xml, together with user supplied values for all or some of these properties. This must be supplied as an element in the same format as in ra.xml, wrapped in a properties tag. It should be supplied by xslt from ra.xml merged with an user configuration xml file. An alternative format has a config-property element with attributes for name and type and the value as content.

Returns:
the ManagedConnectionFactoryProperties value.

setManagedConnectionFactoryProperties

public void setManagedConnectionFactoryProperties(org.w3c.dom.Element managedConnectionFactoryProperties)
Set the ManagedConnectionFactoryProperties value.

Parameters:
managedConnectionFactoryProperties - The ManagedConnectionFactoryProperties value.

getAuthenticationMechanismType

public java.lang.String getAuthenticationMechanismType()
The AuthenticationMechanismType attribute holds the AuthenticationMechanismType from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the AuthenticationMechanismType value.

setAuthenticationMechanismType

public void setAuthenticationMechanismType(java.lang.String authenticationMechanismType)
Set the AuthenticationMechanismType value.

Parameters:
authenticationMechanismType - The AuthenticationMechanismType value.

getCredentialInterface

public java.lang.String getCredentialInterface()
The CredentialInterface attribute holds the CredentialInterface from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the CredentialInterface value.

setCredentialInterface

public void setCredentialInterface(java.lang.String credentialInterface)
Set the CredentialInterface value.

Parameters:
credentialInterface - The CredentialInterface value.

isReauthenticationSupport

public boolean isReauthenticationSupport()
The ReauthenticationSupport attribute holds the ReauthenticationSupport from the ra.xml. It should be supplied by xslt from ra.xml

Returns:
the ReauthenticationSupport value.

setReauthenticationSupport

public void setReauthenticationSupport(boolean reauthenticationSupport)
Set the ReauthenticationSupport value.

Parameters:
reauthenticationSupport - The ReauthenticationSupport value.

getMcfInstance

public ManagedConnectionFactory (src)  getMcfInstance()
The getMcfInstance method returns the ManagedConnectionFactory instance represented by this mbean. It is needed so PasswordCredentials can match up correctly. This will probably have to be implemented as an interceptor when the mcf is directly deployed as an mbean.

Returns:
a ManagedConnectionFactory value

startService

protected void startService()
                     throws java.lang.Exception
Describe startManagedConnectionFactory method here. creates managedConnectionFactory, creates ConnectionFactory, and binds it in jndi. Returns the ManagedConnectionFactory to the ConnectionManager that called us.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
The stopManagedConnectionFactory method unbinds the ConnectionFactory from jndi, releases the ManagedConnectionFactory instane, and releases the ManagedConnectionFactory class.

Overrides:
stopService in class ServiceMBeanSupport (src)

setManagedConnectionFactoryAttribute

public void setManagedConnectionFactoryAttribute(java.lang.String name,
                                                 java.lang.Class clazz,
                                                 java.lang.Object value)
The setManagedConnectionFactoryAttribute method can be used to set attributes on the ManagedConnectionFactory from code, without using the xml configuration.

Parameters:
name - a String value
clazz - a Class value
value - an Object value

setManagedConnectionFactoryAttribute

protected void setManagedConnectionFactoryAttribute(java.lang.String name,
                                                    java.lang.Class clazz,
                                                    java.lang.Object value,
                                                    boolean mustExist)

getManagedConnectionFactoryAttribute

public java.lang.Object getManagedConnectionFactoryAttribute(java.lang.String name)
The getManagedConnectionFactoryAttribute method can be used to examine the managed connection factory properties.

Parameters:
name - a String value
Returns:
an Object value

setMcfProperties

protected void setMcfProperties(java.util.Collection properties,
                                boolean mustExist)
                         throws DeploymentException (src) 
Throws:
DeploymentException (src)

setMcfProperties

protected void setMcfProperties(org.w3c.dom.Element mcfProps)
                         throws DeploymentException (src) 
Throws:
DeploymentException (src)

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws ResourceException (src) 
Creates a connection factory instance.

Specified by:
createConnectionFactory in interface ManagedConnectionFactory (src)
Returns:
the connection factory
Throws:
ResourceException (src) - for a generic error

createConnectionFactory

public java.lang.Object createConnectionFactory(ConnectionManager (src)  cxManager)
                                         throws ResourceException (src) 
Creates a connection factory instance.

Specified by:
createConnectionFactory in interface ManagedConnectionFactory (src)
Parameters:
cxManager - the connection manager
Returns:
the connection factory
Throws:
ResourceException (src) - for a generic error

createManagedConnection

public ManagedConnection (src)  createManagedConnection(javax.security.auth.Subject subject,
                                                 ConnectionRequestInfo (src)  cxRequestInfo)
                                          throws ResourceException (src) 
Creates a new ManagedConnection

Specified by:
createManagedConnection in interface ManagedConnectionFactory (src)
Parameters:
subject - the subject
cxRequestInfo - the connection request info
Returns:
the managed connection
Throws:
ResourceException (src) - for a generic error

equals

public boolean equals(java.lang.Object other)
Tests object for equality

Specified by:
equals in interface ManagedConnectionFactory (src)

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws ResourceException (src) 
Gets the logwriter for this instance.

Specified by:
getLogWriter in interface ManagedConnectionFactory (src)
Returns:
the log writer
Throws:
ResourceException (src) - for a generic error

toString

public java.lang.String toString()
Override toString() so we don't fall fowl an NPE in hashCode


hashCode

public int hashCode()
Generates a hashCode for this object

Specified by:
hashCode in interface ManagedConnectionFactory (src)

matchManagedConnections

public ManagedConnection (src)  matchManagedConnections(java.util.Set connectionSet,
                                                 javax.security.auth.Subject subject,
                                                 ConnectionRequestInfo (src)  cxRequestInfo)
                                          throws ResourceException (src) 
Returns a matching connection from the set.

Specified by:
matchManagedConnections in interface ManagedConnectionFactory (src)
Parameters:
connectionSet - the connection set
subject - the subject
cxRequestInfo - the connection request info
Returns:
the managed connection
Throws:
ResourceException (src) - for a generic error

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws ResourceException (src) 
Sets the logwriter for this instance.

Specified by:
setLogWriter in interface ManagedConnectionFactory (src)
Parameters:
out - the log writer
Throws:
ResourceException (src) - for a generic error