com.ibm.commerce.messaging.adapters.jcasample

Class SampleManagedConnectionFactory

  • java.lang.Object
    • com.ibm.commerce.messaging.adapters.jcasample.SampleManagedConnectionFactory
  • All Implemented Interfaces:
    java.io.Serializable, javax.resource.spi.ManagedConnectionFactory


    public class SampleManagedConnectionFactory
    extends java.lang.Object
    implements javax.resource.spi.ManagedConnectionFactory, java.io.Serializable
    This is the factory class used by an application server to create a physical connection for SampleConnection. It implements the connection management interface (the server part) of the application server contract.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright statement.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object createConnectionFactory()
      This method creates a SampleConnectionFactory.
      java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cm)
      This method creates a SampleConnectionFactory using ConnectionManager.
      javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)
      This method creates a SampleManagedConnection.
      javax.resource.spi.ConnectionManager getConnectionManager()
      This method gets a connection manager.
      java.lang.String getInput()
      This method gets the input.
      java.io.PrintWriter getLogWriter()
      This method gets the log writer.
      java.lang.String getPassword()
      This method gets the password.
      int getTraceLevel()
      This method gets the trace Level.
      java.lang.String getUserName()
      This method gets the user name.
      javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)
      This method matches the managed connections.
      void setInput(java.lang.String theInput)
      This method sets the input.
      void setLogWriter(java.io.PrintWriter pw)
      This method sets the log writer.
      void setPassword(java.lang.String password)
      This method sets the password.
      void setUserName(java.lang.String userName)
      This method sets the user name.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.resource.spi.ManagedConnectionFactory

        equals, hashCode
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        Copyright statement.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SampleManagedConnectionFactory

        public SampleManagedConnectionFactory()
        Default constructor
    • Method Detail

      • createConnectionFactory

        public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cm)
                                                 throws javax.resource.ResourceException
        This method creates a SampleConnectionFactory using ConnectionManager.
        Specified by:
        createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
        Parameters:
        cm - ConnectionManager
        Returns:
        The SampleConnectionFactory.
        Throws:
        javax.resource.ResourceException - Raised when failed to create an instance of SampleConnectionFactory.
      • createConnectionFactory

        public java.lang.Object createConnectionFactory()
                                                 throws javax.resource.ResourceException
        This method creates a SampleConnectionFactory.
        Specified by:
        createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
        Returns:
        The SampleConnectionFactory.
        Throws:
        javax.resource.ResourceException - Raised when failed to create a SampleConnectionFactory.
      • createManagedConnection

        public javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
                                                                            javax.resource.spi.ConnectionRequestInfo info)
                                                                     throws javax.resource.ResourceException
        This method creates a SampleManagedConnection. Subject and ConnectionRequestInfo are not used to create a SampleManagedConnection in the current implementation.
        Specified by:
        createManagedConnection in interface javax.resource.spi.ManagedConnectionFactory
        Parameters:
        subject - The Subject object.
        info - The ConnectionRequestInfo object.
        Returns:
        ManagedConnection The SampleManagedConnection.
        Throws:
        javax.resource.ResourceException - Raised when failed to create SampleManagedConnection.
      • getConnectionManager

        public javax.resource.spi.ConnectionManager getConnectionManager()
        This method gets a connection manager.
        Returns:
        The ConnectionManager.
      • getLogWriter

        public java.io.PrintWriter getLogWriter()
                                         throws javax.resource.ResourceException
        This method gets the log writer.
        Specified by:
        getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
        Returns:
        PrintWriter
        Throws:
        javax.resource.ResourceException
      • setLogWriter

        public void setLogWriter(java.io.PrintWriter pw)
                          throws javax.resource.ResourceException
        This method sets the log writer.
        Specified by:
        setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
        Parameters:
        PrintWriter -
        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
        This method matches the managed connections.
        Specified by:
        matchManagedConnections in interface javax.resource.spi.ManagedConnectionFactory
        Parameters:
        connectionSet - The connectionSet
        subject - The connection subject
        info - ConnectionRequestInfo
        Returns:
        Always null. This method does nothing in current implementation.
        Throws:
        javax.resource.ResourceException
      • setUserName

        public void setUserName(java.lang.String userName)
                         throws javax.resource.ResourceException
        This method sets the user name.
        Parameters:
        userName - The user name
        Throws:
        javax.resource.ResourceException - Raised when any error occured.
      • getUserName

        public java.lang.String getUserName()
                                     throws javax.resource.ResourceException
        This method gets the user name.
        Returns:
        userName
        Throws:
        javax.resource.ResourceException - Raised when any error occured.
      • setPassword

        public void setPassword(java.lang.String password)
                         throws javax.resource.ResourceException
        This method sets the password.
        Parameters:
        password - The password.
        Throws:
        javax.resource.ResourceException - Raised when any error occured.
      • getPassword

        public java.lang.String getPassword()
                                     throws javax.resource.ResourceException
        This method gets the password.
        Returns:
        password
        Throws:
        javax.resource.ResourceException - Raised when any error occured.
      • getTraceLevel

        public int getTraceLevel()
        This method gets the trace Level.
        Returns:
        traceLevel The trace level.
      • getInput

        public java.lang.String getInput()
        This method gets the input.
        Returns:
        input The input.
      • setInput

        public void setInput(java.lang.String theInput)
        This method sets the input.
        Parameters:
        input - The input.