Examples of ComponentContextImpl


Examples of org.apache.felix.scr.impl.manager.ComponentContextImpl

        return true;
    }

    protected Object[] getParameters( Method method, BindParameters bp )
    {
        ComponentContextImpl key = bp.getComponentContext();
        Object[] result = new Object[ m_paramTypes.size()];
        RefPair<?, ?> refPair = bp.getRefPair();
        int i = 0;
        for ( ParamType pt: m_paramTypes ) {
            switch (pt) {
View Full Code Here

Examples of org.apache.felix.scr.impl.manager.ComponentContextImpl

        ComponentContainer container = newContainer();
        SingleComponentManager icm = new SingleComponentManager( container, new ComponentMethods() );
        BindMethod bm = new BindMethod( methodName, component.getClass(),
                FakeService.class.getName(), dsVersion, false, ReferenceMetadata.ReferenceScope.bundle );
        RefPair refPair = new SingleRefPair( m_serviceReference );
        ComponentContextImpl<T1> cc = new ComponentContextImpl(icm, null);
        assertTrue( bm.getServiceObject( cc, refPair, m_context, icm ) );
        BindParameters bp = new BindParameters(cc, refPair);
        bm.invoke( component, bp, null, icm );
        assertEquals( expectCallPerformed, component.callPerformed );
    }
View Full Code Here

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

        return tm;
    }

    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()));
        context.setEnvironment(env);
       
        container.activateComponent(null,
                      component.getComponent(),
                      component.getDescription(),
                      context,
View Full Code Here

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

            if (throwException) {
                throw new MessagingException("Could not find route for exchange: " + exchange + " for service: " + exchange.getService()
                                + " and interface: " + exchange.getInterfaceName());
            } else if (exchange.getMirror().getSyncState() == MessageExchangeImpl.SYNC_STATE_SYNC_SENT) {
                exchange.handleAccept();
                ComponentContextImpl ctx = (ComponentContextImpl) getSubscriptionManager().getContext();
                exchange.setDestinationId(ctx.getComponentNameSpace());
                // TODO: this will fail if exchange is InOut
                getSubscriptionManager().done(exchange);
            }
        }
    }
View Full Code Here

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

            }
            theEndpoint = ep;
        }

        // get the context which created the exchange
        ComponentContextImpl context = exchange.getSourceContext();
        if (theEndpoint == null) {
            QName serviceName = exchange.getService();
            QName interfaceName = exchange.getInterfaceName();

            // check in order, ServiceName then InterfaceName
View Full Code Here

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

                    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.ComponentContextImpl

                    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.ComponentContextImpl

        }
        if (scheduleIterator == null) {
          scheduleIterator = new PollScheduleIterator();
        }
        if (workManager == null) {
            ComponentContextImpl context = (ComponentContextImpl) getContext();
            workManager = context.getWorkManager();
        }
        super.init();
      
    }
View Full Code Here

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

        }
    }

    protected void init() throws JBIException {
        if (workManager == null) {
            ComponentContextImpl context = (ComponentContextImpl) getContext();
            workManager = context.getWorkManager();
        }
        super.init();
    }
View Full Code Here

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

            if (throwException) {
                throw new MessagingException("Could not find route for exchange: " + exchange + " for service: " + exchange.getService() + " and interface: "
                        + exchange.getInterfaceName());
            } else if (exchange.getMirror().getSyncState() == MessageExchangeImpl.SYNC_STATE_SYNC_SENT) {
                exchange.handleAccept();
                ComponentContextImpl ctx = (ComponentContextImpl) getSubscriptionManager().getContext();
                exchange.setDestinationId(ctx.getComponentNameSpace());
                // TODO: this will fail if exchange is InOut
                getSubscriptionManager().done(exchange);
            }
        }
    }
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.