Examples of JMSBridge


Examples of net.timewalker.ffmq3.cluster.bridge.JMSBridge

            BridgeDefinition[] bridgeDefs = bridgeDefinitionProvider.getBridgeDefinitions();
            for (int i = 0; i < bridgeDefs.length; i++)
            {
                log.debug("Deploying JMS bridge : "+bridgeDefs[i].getName());
                JMSBridge bridge = new JMSBridge(bridgeDefs[i]);
                if (bridgeDefs[i].isEnabled())
                    bridge.start();
                else
                    log.debug("JMS bridge is disabled : "+bridgeDefs[i].getName());
                bridges.add(bridge);
                bridgeDeployed(bridge);
            }
View Full Code Here

Examples of net.timewalker.ffmq3.cluster.bridge.JMSBridge

   
    private void undeployBridges()
    {
        for (int i = 0; i < bridges.size(); i++)
        {
            JMSBridge bridge = (JMSBridge)bridges.get(i);
           
            log.debug("Undeploying JMS bridge : "+bridge.getBridgeDefinition().getName());
            if (bridge.isStarted())
                bridge.stop();
            bridgeUndeployed(bridge);
        }
        bridges.clear();
    }
View Full Code Here

Examples of org.hornetq.jms.bridge.JMSBridge

            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));

                String moduleName = resolveAttribute(JMSBridgeDefinition.MODULE, context, model);
                final JMSBridge bridge = createJMSBridge(context, model);

                final String bridgeName = address.getLastElement().getValue();
                final JMSBridgeService bridgeService = new JMSBridgeService(moduleName, bridgeName, bridge);
                final ServiceName bridgeServiceName = MessagingServices.getJMSBridgeServiceName(bridgeName);
View Full Code Here

Examples of org.hornetq.jms.bridge.JMSBridge

        if (bridgeService == null) {
            PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
            throw ControllerLogger.ROOT_LOGGER.managementResourceNotFound(address);
        }

        final JMSBridge bridge = JMSBridge.class.cast(bridgeService.getValue());

        if (READ_ATTRIBUTE_OPERATION.equals(operationName)) {
            readAttributeValidator.validate(operation);
            final String name = operation.require(NAME).asString();
            if (STARTED.equals(name)) {
                context.getResult().set(bridge.isStarted());
            } else if (PAUSED.getName().equals(name)) {
                context.getResult().set(bridge.isPaused());
            } else {
                throw MessagingLogger.ROOT_LOGGER.unsupportedAttribute(name);
            }
        }
        else if (START.equals(operationName)) {
            try {
                // we do not start the bridge directly but call startBridge() instead
                // to ensure the class loader will be able to load any external resources
                JMSBridgeService service = (JMSBridgeService) bridgeService.getService();
                service.startBridge();
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else if (STOP.equals(operationName)) {
            try {
                bridge.stop();
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else if (PAUSE.equals(operationName)) {
            try {
                bridge.pause();
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else if (RESUME.equals(operationName)) {
            try {
                bridge.resume();
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else {
            throw MessagingLogger.ROOT_LOGGER.unsupportedOperation(operationName);
        }

        context.completeStep(new OperationContext.RollbackHandler() {
            @Override
            public void handleRollback(OperationContext context, ModelNode operation) {
                try {
                    if (START.equals(operationName)) {
                        bridge.stop();
                    } else if (STOP.equals(operationName)) {
                        JMSBridgeService service = (JMSBridgeService) bridgeService.getService();
                        service.startBridge();
                    } else if (PAUSE.equals(operationName)) {
                        bridge.resume();
                    } else if (RESUME.equals(operationName)) {
                        bridge.pause();
                    }
                } catch (Exception e) {
                    MessagingLogger.ROOT_LOGGER.revertOperationFailed(e, getClass().getSimpleName(), operation
                            .require(ModelDescriptionConstants.OP).asString(), PathAddress.pathAddress(operation
                            .require(ModelDescriptionConstants.OP_ADDR)));
View Full Code Here

Examples of org.hornetq.jms.bridge.JMSBridge

            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));

                String moduleName = resolveAttribute(JMSBridgeDefinition.MODULE, context, model);
                final JMSBridge bridge = createJMSBridge(context, model);

                final String bridgeName = address.getLastElement().getValue();
                final JMSBridgeService bridgeService = new JMSBridgeService(moduleName, bridgeName, bridge);
                final ServiceName bridgeServiceName = MessagingServices.getJMSBridgeServiceName(bridgeName);
View Full Code Here

Examples of org.hornetq.jms.bridge.JMSBridge

        final ServiceController<?> bridgeService = context.getServiceRegistry(modify).getService(bridgeServiceName);
        if (bridgeService == null) {
            throw new OperationFailedException(MessagingMessages.MESSAGES.hqServerManagementServiceResourceNotFound(PathAddress.pathAddress(operation.require(OP_ADDR))));
        }

        final JMSBridge bridge = JMSBridge.class.cast(bridgeService.getValue());

        if (READ_ATTRIBUTE_OPERATION.equals(operationName)) {
            readAttributeValidator.validate(operation);
            final String name = operation.require(NAME).asString();
            if (STARTED.equals(name)) {
                context.getResult().set(bridge.isStarted());
            } else if (PAUSED.getName().equals(name)) {
                context.getResult().set(bridge.isPaused());
            } else {
                throw MESSAGES.unsupportedAttribute(name);
            }
        }
        else if (START.equals(operationName)) {
            try {
                // we do not start the bridge directly but call startBridge() instead
                // to ensure the class loader will be able to load any external resources
                JMSBridgeService service = (JMSBridgeService) bridgeService.getService();
                service.startBridge();
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else if (STOP.equals(operationName)) {
            try {
                bridge.stop();
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else if (PAUSE.equals(operationName)) {
            try {
                bridge.pause();
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else if (RESUME.equals(operationName)) {
            try {
                bridge.resume();
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else {
            throw MESSAGES.unsupportedOperation(operationName);
        }

        context.completeStep(new OperationContext.RollbackHandler() {
            @Override
            public void handleRollback(OperationContext context, ModelNode operation) {
                try {
                    if (START.equals(operationName)) {
                        bridge.stop();
                    } else if (STOP.equals(operationName)) {
                        JMSBridgeService service = (JMSBridgeService) bridgeService.getService();
                        service.startBridge();
                    } else if (PAUSE.equals(operationName)) {
                        bridge.resume();
                    } else if (RESUME.equals(operationName)) {
                        bridge.pause();
                    }
                } catch (Exception e) {
                    ROOT_LOGGER.revertOperationFailed(e, getClass().getSimpleName(), operation
                            .require(ModelDescriptionConstants.OP).asString(), PathAddress.pathAddress(operation
                            .require(ModelDescriptionConstants.OP_ADDR)));
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.