xmlBlaster 2.2.0 API

org.xmlBlaster.j2ee.k2
Class BlasterManagedConnectionFactory

java.lang.Object
  extended by org.xmlBlaster.j2ee.k2.BlasterManagedConnectionFactory
All Implemented Interfaces:
java.io.Serializable, javax.resource.spi.ManagedConnectionFactory

public class BlasterManagedConnectionFactory
extends java.lang.Object
implements javax.resource.spi.ManagedConnectionFactory

Factory for a specific XmlBlaster instance.

Set the configuration up in ra.xml. OBS At least in JBoss this is not possible, you have to configure all properties in the *-service.xml file.

*

if given a jndiName, the connector will try to lookup a GlobalUtil wich contains the serverside engine.Global. This way, the in vm LOCAL protocol is possible to use.

The loading order of properties is: engine.Global, propertyFile, arguments set on the resource adapter.

if the protocol used is IOR, a jacorb.properties file will be loaded through the context classloader if found. This is beacuse jacorb tries to load the file from the system classloader, and its not available there when embedding xmlBlaster in JBoss.

Author:
Peter Antman
See Also:
Serialized Form

Field Summary
private  Global glob
           
private  GlobalUtil globalUtil
           
private  java.lang.String jndiName
           
private static java.util.logging.Logger log
           
private  java.io.PrintWriter logWriter
           
 java.lang.String myName
           
private  java.lang.String propFile
           
private  java.util.Properties props
           
private static long serialVersionUID
           
 
Constructor Summary
BlasterManagedConnectionFactory()
           
 
Method Summary
 java.lang.Object createConnectionFactory()
          Create a "non managed" connection factory.
 java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
          Create a ConnectionFactory with appserver hook
 javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)
          Create a new connection to manage in pool
 boolean equals(java.lang.Object obj)
           
 java.lang.String getClientProtocol()
          Null if not
(package private)  Global getConfig()
          Return a clone of the Global, so that new XmlBlasterAccess instances may be created.
 java.lang.String getIor()
          Null if not
 java.lang.String getIorFile()
          Null if not
 java.lang.String getIorHost()
          Null if not
 java.lang.String getIorPort()
          Null if not
 java.lang.String getJNDIName()
           
 java.io.PrintWriter getLogWriter()
           
 java.lang.String getMaxSession()
          Null if not.
 java.lang.String getPassword()
           
 java.lang.String getPropertyFileName()
           
 java.lang.String getRmiAuthserverUrl()
          Null if not
 java.lang.String getRmiHostname()
          Null if not
 java.lang.String getRmiRegistryPort()
          Null if not
 java.lang.String getSecurityPlugin()
          Null if not.
 java.lang.String getSessionTimeout()
          Null if not.
 java.lang.String getUserName()
           
 int hashCode()
           
private  void loadPropertyFile()
           
 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
 void setClientProtocol(java.lang.String arg)
          The driver to use: IOR | RMI | LOCAL Have to verify the others to.
 void setIor(java.lang.String arg)
          Set the ior string.
 void setIorFile(java.lang.String arg)
          Set the ior string through a file.
 void setIorHost(java.lang.String arg)
          Set the hostName or IP where xmlBlaster is running.
 void setIorPort(java.lang.String arg)
          Set bootstrapPort where the internal xmlBlaster-http server publishes its Ior.
 void setJNDIName(java.lang.String jndiName)
          Set a JNDI name where a GlobalUtil will be lookedup.
 void setLogWriter(java.io.PrintWriter out)
          FIXME
 void setMaxSessions(java.lang.String arg)
          Set the maximum number of sessions a user is allowed to have opened.
 void setPassword(java.lang.String arg)
          Set a default password name.
 void setPropertyFileName(java.lang.String fileName)
          Set the name of a propertyfile to read settings from.
 void setRmiAuthserverUrl(java.lang.String arg)
          Set the rmi registry port.
 void setRmiHostname(java.lang.String arg)
          Set the rmi hostname.
 void setRmiRegistryPort(java.lang.String arg)
          Set the rmi registry port.
 void setSecurityPlugin(java.lang.String arg)
          Set the security plugin to use, see org.xmlBlaster.authentication.plugins.
 void setSessionTimeout(java.lang.String arg)
          Set the session login timeout.
 void setUserName(java.lang.String arg)
          Set a default user name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

myName

public java.lang.String myName

glob

private Global glob

globalUtil

private GlobalUtil globalUtil

propFile

private java.lang.String propFile

jndiName

private java.lang.String jndiName

logWriter

private java.io.PrintWriter logWriter

props

private java.util.Properties props
Constructor Detail

BlasterManagedConnectionFactory

public BlasterManagedConnectionFactory()
                                throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException
Method Detail

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws javax.resource.ResourceException
Create a "non managed" connection factory. No appserver involved

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

createConnectionFactory

public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
                                         throws javax.resource.ResourceException
Create a ConnectionFactory with appserver hook

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

createManagedConnection

public javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo info)
                                                             throws javax.resource.ResourceException
Create a new connection to manage in pool

Specified by:
createManagedConnection in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

matchManagedConnections

public javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
                                                                    javax.security.auth.Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo info)
                                                             throws javax.resource.ResourceException
Match a set of connections from the pool

Specified by:
matchManagedConnections in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws javax.resource.ResourceException
FIXME

Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
hashCode in class java.lang.Object

setUserName

public void setUserName(java.lang.String arg)
Set a default user name.


getUserName

public java.lang.String getUserName()

setPassword

public void setPassword(java.lang.String arg)
Set a default password name.


getPassword

public java.lang.String getPassword()

setClientProtocol

public void setClientProtocol(java.lang.String arg)
The driver to use: IOR | RMI | LOCAL Have to verify the others to. Don't forget to configure the server.


getClientProtocol

public java.lang.String getClientProtocol()
Null if not


setRmiHostname

public void setRmiHostname(java.lang.String arg)
Set the rmi hostname. Only when driver RMI.


getRmiHostname

public java.lang.String getRmiHostname()
Null if not


setRmiRegistryPort

public void setRmiRegistryPort(java.lang.String arg)
Set the rmi registry port. Only when driver RMI.


getRmiRegistryPort

public java.lang.String getRmiRegistryPort()
Null if not


setRmiAuthserverUrl

public void setRmiAuthserverUrl(java.lang.String arg)
Set the rmi registry port. Only when driver RMI.


getRmiAuthserverUrl

public java.lang.String getRmiAuthserverUrl()
Null if not


setIor

public void setIor(java.lang.String arg)
Set the ior string. Only when driver IOR


getIor

public java.lang.String getIor()
Null if not


setIorFile

public void setIorFile(java.lang.String arg)
Set the ior string through a file. Only when driver IOR


setIorHost

public void setIorHost(java.lang.String arg)
Set the hostName or IP where xmlBlaster is running. Only when driver IOR


getIorHost

public java.lang.String getIorHost()
Null if not


setIorPort

public void setIorPort(java.lang.String arg)
Set bootstrapPort where the internal xmlBlaster-http server publishes its Ior. Only when driver IOR


getIorPort

public java.lang.String getIorPort()
Null if not


getIorFile

public java.lang.String getIorFile()
Null if not


setSecurityPlugin

public void setSecurityPlugin(java.lang.String arg)
Set the security plugin to use, see org.xmlBlaster.authentication.plugins.


getSecurityPlugin

public java.lang.String getSecurityPlugin()
Null if not.


setSessionTimeout

public void setSessionTimeout(java.lang.String arg)
Set the session login timeout.


getSessionTimeout

public java.lang.String getSessionTimeout()
Null if not.


setMaxSessions

public void setMaxSessions(java.lang.String arg)
Set the maximum number of sessions a user is allowed to have opened. This must be coordinated with the JCA pooling settings.


getMaxSession

public java.lang.String getMaxSession()
Null if not.


setPropertyFileName

public void setPropertyFileName(java.lang.String fileName)
Set the name of a propertyfile to read settings from.

if this option is set, all properties specifyed in it will overwrite any properties sett on this ra, since the file will be loaded last.

The context classloader will be searched first, then normal XmlBlaster search algoritm will be used.


getPropertyFileName

public java.lang.String getPropertyFileName()

setJNDIName

public void setJNDIName(java.lang.String jndiName)
Set a JNDI name where a GlobalUtil will be lookedup.


getJNDIName

public java.lang.String getJNDIName()

loadPropertyFile

private void loadPropertyFile()
                       throws javax.resource.spi.IllegalStateException
Throws:
javax.resource.spi.IllegalStateException

getConfig

Global getConfig()
Return a clone of the Global, so that new XmlBlasterAccess instances may be created.


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.