Examples of CachedConnectionManager


Examples of com.taobao.datasource.resource.connectionmanager.CachedConnectionManager

        setUpDatabase();
        setUpDataSource();
    }

    private void setUpDataSource() throws Exception {
        CachedConnectionManager ccm = new CachedConnectionManager();
        ccm.setTransactionManager(TxManager.getInstance());
        ccm.init();

        ltds = new LocalTxDataSource();
        ltds.setBeanName(randomAlphanumeric(32));

        ltds.setTransactionManager(TxManager.getInstance());
View Full Code Here

Examples of com.taobao.datasource.resource.connectionmanager.CachedConnectionManager

    public void setUp() throws Exception {
        SecureIdentityLoginModule securityDomain = new SecureIdentityLoginModule();
        securityDomain.setUserName("water");
        securityDomain.setPassword(SecureIdentityLoginModule.encode("water"));

        CachedConnectionManager ccm = new CachedConnectionManager();
        ccm.setTransactionManager(TxManager.getInstance());
        ccm.init();

        ltds = new LocalTxDataSource();
        ltds.setBeanName(randomAlphanumeric(32));

        ltds.setTransactionManager(TxManager.getInstance());
View Full Code Here

Examples of org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager


        @Override
        public void setup(final Map<String, Object> properties) {
            try {
                final CachedConnectionManager connectionManager = cachedConnectionManager.getOptionalValue();
                if (connectionManager != null) {
                    connectionManager.pushMetaAwareObject(this, unsharable);
                }
            } catch (ResourceException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

Examples of org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager

        }

        @Override
        public void teardown(final Map<String, Object> properties) {
            try {
                final CachedConnectionManager connectionManager = cachedConnectionManager.getOptionalValue();
                if (connectionManager != null) {
                    connectionManager.popMetaAwareObject(unsharable);
                }
            } catch (ResourceException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

Examples of org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager

        if (context.isNormalServer()) {
            context.addStep(new OperationStepHandler() {

                @Override
                public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
                    CachedConnectionManager ccm = (CachedConnectionManager) context.getServiceRegistry(false).getService(ConnectorServices.CCM_SERVICE).getValue();
                    int number = ccm.getNumberOfConnections();
                    ModelNode result = new ModelNode();
                    result.add(number);

                    context.getResult().set(result);
                    context.stepCompleted();
View Full Code Here

Examples of org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager

        if (context.isNormalServer()) {
            context.addStep(new OperationStepHandler() {

                @Override
                public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
                    CachedConnectionManager ccm = (CachedConnectionManager) context.getServiceRegistry(false).getService(ConnectorServices.CCM_SERVICE).getValue();
                    Map<String, String> map= ccm.listConnections();
                    ModelNode result = new ModelNode();
                    for (Map.Entry<String, String> entry : map.entrySet()) {
                        result.add(entry.getKey(), entry.getValue());
                    }
View Full Code Here

Examples of org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager

    }

    @Override
    protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<JcaSubsystemConfiguration> jcaSubsystemConfigurationHandbackHolder) throws OperationFailedException {

        CachedConnectionManager ccm = (CachedConnectionManager) context.getServiceRegistry(true).getService(ConnectorServices.CCM_SERVICE).getValue();

        if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.DEBUG.getAttribute().getName())) {
            ccm.setDebug(resolvedValue.asBoolean());
        } else if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.ERROR.getAttribute().getName())) {
            ccm.setError(resolvedValue.asBoolean());
        } else if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.IGNORE_UNKNOWN_CONNECTIONS.getAttribute().getName())) {
            ccm.setIgnoreUnknownConnections(resolvedValue.asBoolean());
        }


        return false;
View Full Code Here

Examples of org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager

    }

    @Override
    protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, JcaSubsystemConfiguration handback) throws OperationFailedException {

        CachedConnectionManager ccm = (CachedConnectionManager) context.getServiceRegistry(true).getService(ConnectorServices.CCM_SERVICE).getValue();

        if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.DEBUG.getAttribute().getName())) {
            ccm.setDebug(valueToRestore.asBoolean());
        } else if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.ERROR.getAttribute().getName())) {
            ccm.setError(valueToRestore.asBoolean());
        } else if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.IGNORE_UNKNOWN_CONNECTIONS.getAttribute().getName())) {
            ccm.setIgnoreUnknownConnections(valueToRestore.asBoolean());
        }

    }
View Full Code Here

Examples of org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager

    }

    @Override
    protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, JcaSubsystemConfiguration handback) throws OperationFailedException {

        CachedConnectionManager ccm = (CachedConnectionManager) context.getServiceRegistry(true).getService(ConnectorServices.CCM_SERVICE).getValue();

        if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.DEBUG.getAttribute().getName())) {
            ccm.setDebug(valueToRestore.asBoolean());
        } else if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.ERROR.getAttribute().getName())) {
            ccm.setError(valueToRestore.asBoolean());
        } else if (attributeName.equals(JcaCachedConnectionManagerDefinition.CcmParameters.IGNORE_UNKNOWN_CONNECTIONS.getAttribute().getName())) {
            ccm.setIgnoreUnknownConnections(valueToRestore.asBoolean());
        }

    }
View Full Code Here

Examples of org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager

    @Override
    protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<JcaSubsystemConfiguration> jcaSubsystemConfigurationHandbackHolder) throws OperationFailedException {
        JcaSubsystemConfiguration config = (JcaSubsystemConfiguration) context.getServiceRegistry(false).getService(ConnectorServices.CONNECTOR_CONFIG_SERVICE).getValue();

        CachedConnectionManager ccm = (CachedConnectionManager) context.getServiceRegistry(false).getService(ConnectorServices.CCM_SERVICE).getValue();

        if (attributeName.equals(ArchiveValidationAdd.ArchiveValidationParameters.ARCHIVE_VALIDATION_ENABLED.getAttribute().getName())) {
            config.setArchiveValidation(resolvedValue.asBoolean());
        }

        if (attributeName.equals(ArchiveValidationAdd.ArchiveValidationParameters.ARCHIVE_VALIDATION_FAIL_ON_ERROR.getAttribute().getName())) {
            config.setArchiveValidationFailOnError(resolvedValue.asBoolean());
        }
        if (attributeName.equals(ArchiveValidationAdd.ArchiveValidationParameters.ARCHIVE_VALIDATION_FAIL_ON_WARN.getAttribute().getName())) {
            config.setArchiveValidationFailOnWarn(resolvedValue.asBoolean());
        }

        if (attributeName.equals(BeanValidationAdd.BeanValidationParameters.BEAN_VALIDATION_ENABLED.getAttribute().getName())) {
            config.setBeanValidation(resolvedValue.asBoolean());
        }

        if (attributeName.equals(BeanValidationAdd.BeanValidationParameters.BEAN_VALIDATION_ENABLED.getAttribute().getName())) {
                    config.setBeanValidation(resolvedValue.asBoolean());
        }

        if (attributeName.equals(CachedConnectionManagerAdd.CcmParameters.DEBUG.getAttribute().getName())) {
            ccm.setDebug(resolvedValue.asBoolean());
        }

        if (attributeName.equals(CachedConnectionManagerAdd.CcmParameters.ERROR.getAttribute().getName())) {
            ccm.setError(resolvedValue.asBoolean());
        }


        return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.