Package javax.resource.spi

Examples of javax.resource.spi.ConnectionManager


*/
public class DataSourceTestCase extends AbstractProxyTest
{
   public void testConnectionManager() throws Exception
   {
      ConnectionManager cm = new TestConnectionManager();
      ManagedConnectionFactory mcf = new TestManagedConnectionFactory();
      SimpleMetaData metadata = new SimpleMetaData();
     
      metadata.addMetaData(ConnectionFactoryInterceptor.CONNECTION_FACTORY, ConnectionFactoryInterceptor.CONNECTION_MANAGER, cm);
      metadata.addMetaData(ConnectionFactoryInterceptor.CONNECTION_MANAGER, ConnectionFactoryInterceptor.MANAGED_CONNECTION_FACTORY, mcf);
View Full Code Here


   public static final String CONNECTION_MANAGER = "CONNECTION_MANAGER";
   public static final String MANAGED_CONNECTION_FACTORY = "MANAGED_CONNECTION_FACTORY";
  
   public Object invoke(Invocation invocation) throws Throwable
   {
      ConnectionManager cm = (ConnectionManager) invocation.getMetaData(CONNECTION_FACTORY, CONNECTION_MANAGER);
      ManagedConnectionFactory mcf = (ManagedConnectionFactory) invocation.getMetaData(CONNECTION_MANAGER, MANAGED_CONNECTION_FACTORY);
     
      return cm.allocateConnection(mcf, null);
   }
View Full Code Here

            }

        } else if (object instanceof ConnectorReference) {
            final ConnectorReference cr = (ConnectorReference) object;
            try {
                final ConnectionManager cm = cr.getConnectionManager();
                if (cm != null && cm instanceof AbstractConnectionManager) {
                    ((AbstractConnectionManager) cm).doStop();
                }
            } catch (final Exception e) {
                logger.debug("Not processing resource on destroy: " + className, e);
View Full Code Here

            connectionManagerRecipe.setProperty("classLoader", classLoader);

            logger.getChildLogger("service").info("createResource.createConnectionManager", serviceInfo.id, service.getClass().getName());

            // create the connection manager
            final ConnectionManager connectionManager = (ConnectionManager) connectionManagerRecipe.create();
            if (connectionManager == null) {
                throw new OpenEJBRuntimeException(messages.format("assembler.invalidConnectionManager", serviceInfo.id));
            }

            final Map<String, Object> unsetA = serviceRecipe.getUnsetProperties();
View Full Code Here

     * @throws ConnectorRuntimeException when unable to provide a connection manager
     */
    public ConnectionManager obtainConnectionManager(PoolInfo poolInfo,
                                                     boolean forceNoLazyAssoc, ResourceInfo resourceInfo)
            throws ConnectorRuntimeException {
        ConnectionManager mgr = ConnectionManagerFactory.
                getAvailableConnectionManager(poolInfo, forceNoLazyAssoc, resourceInfo);
        return mgr;
    }
View Full Code Here

            }

        } else if (object instanceof ConnectorReference) {
            final ConnectorReference cr = (ConnectorReference) object;
            try {
                final ConnectionManager cm = cr.getConnectionManager();
                if (cm != null && cm instanceof AbstractConnectionManager) {
                    ((AbstractConnectionManager) cm).doStop();
                }
            } catch (final Exception e) {
                logger.debug("Not processing resource on destroy: " + className, e);
View Full Code Here

            connectionManagerRecipe.setProperty("classLoader", classLoader);

            logger.getChildLogger("service").info("createResource.createConnectionManager", serviceInfo.id, service.getClass().getName());

            // create the connection manager
            final ConnectionManager connectionManager = (ConnectionManager) connectionManagerRecipe.create();
            if (connectionManager == null) {
                throw new OpenEJBRuntimeException(messages.format("assembler.invalidConnectionManager", serviceInfo.id));
            }

            final Map<String, Object> unsetA = serviceRecipe.getUnsetProperties();
View Full Code Here

     * @throws ConnectorRuntimeException when unable to provide a connection manager
     */
    public ConnectionManager obtainConnectionManager(PoolInfo poolInfo,
                                                     boolean forceNoLazyAssoc, ResourceInfo resourceInfo)
            throws ConnectorRuntimeException {
        ConnectionManager mgr = ConnectionManagerFactory.
                getAvailableConnectionManager(poolInfo, forceNoLazyAssoc, resourceInfo);
        return mgr;
    }
View Full Code Here

                1,
                true,
                false,
                false);

        ConnectionManager connectionManager = new GenericConnectionManager(
                    transactionSupport,
                    poolingSupport,
                    null,
                    connectionTracker,
                    (RecoverableTransactionManager) _txManager,
View Full Code Here

            }

        } else if (object instanceof ConnectorReference) {
            final ConnectorReference cr = (ConnectorReference) object;
            try {
                final ConnectionManager cm = cr.getConnectionManager();
                if (cm != null && cm instanceof AbstractConnectionManager) {
                    ((AbstractConnectionManager) cm).doStop();
                }
            } catch (Exception e) {
                logger.debug("Not processing resource on destroy: " + className, e);
View Full Code Here

TOP

Related Classes of javax.resource.spi.ConnectionManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.