Package org.servicemix.jbi.framework

Examples of org.servicemix.jbi.framework.ComponentNameSpace


     * Put the packet in the queue for later processing.
     * @param packet
     * @throws JBIException
     */
    protected void enqueuePacket(MessageExchangeImpl me) throws JBIException {
        ComponentNameSpace cns = me.getDestinationId();
        SedaQueue queue = (SedaQueue) queueMap.get(cns);
        if (queue == null) {
            queue = new SedaQueue(cns);
            queueMap.put(cns, queue);
            queue.init(this, capacity);
View Full Code Here


     * @param event
     */
    public synchronized void onEvent(ComponentPacketEvent event) {
        // watch for deactivations
        if (event.getStatus() == ComponentPacketEvent.DEACTIVATED) {
            ComponentNameSpace cns = event.getPacket().getComponentNameSpace();
            SedaQueue queue = (SedaQueue) queueMap.remove(cns);
            if (queue != null) {
                try {
                    queue.shutDown();
                    unregisterQueue(queue);
View Full Code Here

     * @param packet
     * @throws MessagingException
     */
    public void doRouting(final MessageExchangeImpl me) throws MessagingException {
       
        ComponentNameSpace id = me.getRole() == Role.PROVIDER ? me.getDestinationId() : me.getSourceId();
        ComponentConnector cc = broker.getRegistry().getComponentConnector(id);
        if (cc != null) {
          if (me.getMirror().getSyncState() != MessageExchangeImpl.SYNC_STATE_ASYNC) {
            throw new IllegalStateException("sendSync can not be used on jca flow with external components");
          }
            try {
                final String componentName = cc.getComponentNameSpace().getName();
                JmsTemplate jt = isPersistent(me) ? jmsPersistentTemplate : jmsTemplate;
                String destination = "";
                if (me.getRole() == Role.PROVIDER){
                    destination = INBOUND_PREFIX + componentName;
                }else {
                    destination = INBOUND_PREFIX + id.getContainerName();
                }
                jt.send(destination, new MessageCreator() {
          public Message createMessage(Session session) throws JMSException {
                      return session.createObjectMessage(me);
          }
View Full Code Here

     *
     * @param id - the unique component ID
     * @throws JBIException
     */
    public void deactivateComponent(String id) throws JBIException {
        ComponentNameSpace cns = new ComponentNameSpace(name, id, id);
        Component component = registry.getComponent(cns);
        if (component != null) {
            LocalComponentConnector lcc = registry.getLocalComponentConnector(cns);
            if (lcc != null) {
                environmentContext.unreregister(lcc, true);
View Full Code Here

     *
     * @param id
     * @return the component
     */
    public Component getComponent(String id) {
        ComponentNameSpace cns = new ComponentNameSpace(name, id, id);
        return registry.getComponent(cns);
    }
View Full Code Here

     *
     * @param componentName
     * @return the LocalComponentConnector
     */
    public LocalComponentConnector getLocalComponentConnector(String componentName) {
        ComponentNameSpace cns = new ComponentNameSpace(name, componentName, componentName);
        return registry.getLocalComponentConnector(cns);
    }
View Full Code Here

     * @return the ObjectName of the MBean for the Component
     * @throws JBIException
     */
    public ObjectName activateComponent(Component component, String name) throws JBIException {
        ActivationSpec activationSpec = new ActivationSpec();
        ComponentNameSpace cns = new ComponentNameSpace(getName(), name, name);
        activationSpec.setComponent(component);
        activationSpec.setComponentName(cns.getName());
        return activateComponent(component, activationSpec);
    }
View Full Code Here

     * @return the ObjectName of the Component's MBean
     * @throws JBIException
     */
    public ObjectName activateComponent(File installDir, Component component, String description,
                                        ComponentContextImpl context, boolean binding, boolean service) throws JBIException {
        ComponentNameSpace cns = context.getComponentNameSpace();
        ActivationSpec activationSpec = new ActivationSpec();
        activationSpec.setComponent(component);
        activationSpec.setComponentName(cns.getName());
        return activateComponent(installDir, component, description, context, activationSpec, false, binding, service);
    }
View Full Code Here

     * @return the ObjectName of the Component's MBean
     * @throws JBIException
     */
    public ObjectName activateComponent(Component component, String description, ActivationSpec activationSpec,
                                        boolean pojo, boolean binding, boolean service) throws JBIException {
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName(), activationSpec.getId());
        ComponentContextImpl context = new ComponentContextImpl(this, cns);
        return activateComponent(new File("."), component, description, context, activationSpec, pojo, binding, service);
    }
View Full Code Here

     */
    public ObjectName activateComponent(File installationDir, Component component, String description,
                                        ComponentContextImpl context, ActivationSpec activationSpec, boolean pojo, boolean binding, boolean service)
            throws JBIException {
        ObjectName result = null;
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName(), activationSpec.getId());
        log.info("Activating component for: " + cns + " with service: " + activationSpec.getService() + " component: "
                + component);
        DeliveryChannelImpl dc = new DeliveryChannelImpl(this, activationSpec.getComponentName());
        LocalComponentConnector lcc = registry.registerComponent(cns, description, component, dc, binding, service);
        if (lcc != null) {
View Full Code Here

TOP

Related Classes of org.servicemix.jbi.framework.ComponentNameSpace

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.