Examples of ComponentNameSpace


Examples of org.apache.servicemix.jbi.framework.ComponentNameSpace

     * @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, String[] sharedLibraries) throws JBIException {
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName());
        if (registry.getComponent(cns) != null) {
            throw new JBIException("A component is already registered for " + cns);
        }
        ComponentContextImpl context = new ComponentContextImpl(this, cns);
        return activateComponent(new File("."), component, description, context, activationSpec, pojo, binding, service, sharedLibraries);
View Full Code Here

Examples of org.apache.servicemix.jbi.framework.ComponentNameSpace

    public ObjectName activateComponent(File installationDir, Component component,
                                        String description, ComponentContextImpl context,
                                        ActivationSpec activationSpec, boolean pojo,
                                        boolean binding, boolean service, String[] sharedLibraries) throws JBIException {
        ObjectName result = null;
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName());
        LOGGER.info("Activating component {}", cns);
        ComponentMBeanImpl lcc = registry.registerComponent(cns, description, component, binding, service, sharedLibraries);
        if (lcc != null) {
            lcc.setPojo(pojo);
            ComponentEnvironment env = environmentContext.registerComponent(context.getEnvironment(), lcc);
View Full Code Here

Examples of org.apache.servicemix.jbi.framework.ComponentNameSpace

    protected ServiceEndpoint[] getMatchingEndpoints(ServiceEndpoint[] endpoints, MessageExchangeImpl exchange) {
        List<ServiceEndpoint> filtered = new ArrayList<ServiceEndpoint>();
        ComponentMBeanImpl consumer = getRegistry().getComponent(exchange.getSourceId());

        for (int i = 0; i < endpoints.length; i++) {
            ComponentNameSpace id = ((InternalEndpoint) endpoints[i]).getComponentNameSpace();
            if (id != null) {
                ComponentMBeanImpl provider = getRegistry().getComponent(id);
                if (provider != null
                        && (!consumer.getComponent().isExchangeWithProviderOkay(endpoints[i], exchange)
                                || !provider.getComponent().isExchangeWithConsumerOkay(endpoints[i], exchange))) {
View Full Code Here

Examples of org.apache.servicemix.jbi.framework.ComponentNameSpace

    public JBIContainer getJBIContainer() {
        return container;
    }
   
    public void register(Component component) throws Exception {
        ComponentNameSpace cns = new ComponentNameSpace(container.getName(), component.getName());
        ComponentContextImpl context = new ComponentContextImpl(container, cns);
        ComponentEnvironment env = new ComponentEnvironment();
        env.setComponentRoot(new File(component.getRootDir()));
        env.setInstallRoot(new File(component.getInstallDir()));
        env.setWorkspaceRoot(new File(component.getWorkDir()));
View Full Code Here

Examples of org.apache.servicemix.jbi.framework.ComponentNameSpace

    public JBIContainer getJBIContainer() {
        return container;
    }
   
    public void register(Component component) throws Exception {
        ComponentNameSpace cns = new ComponentNameSpace(container.getName(), component.getName());
        ComponentContextImpl context = new ComponentContextImpl(container, cns);
        ComponentEnvironment env = new ComponentEnvironment();
        env.setComponentRoot(new File(component.getRootDir()));
        env.setInstallRoot(new File(component.getInstallDir()));
        env.setWorkspaceRoot(new File(component.getWorkDir()));
View Full Code Here

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

Examples of org.servicemix.jbi.framework.ComponentNameSpace

     * @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

Examples of org.servicemix.jbi.framework.ComponentNameSpace

     * @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

Examples of org.servicemix.jbi.framework.ComponentNameSpace

     *
     * @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

Examples of org.servicemix.jbi.framework.ComponentNameSpace

     *
     * @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
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.