Package org.apache.tuscany.sca.core

Examples of org.apache.tuscany.sca.core.ExtensionPointRegistry


    public void testMixedParameters() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<Mixed> ctor1 = Mixed.class.getConstructor(String.class, String.class, String.class);
        processor.visitConstructor(ctor1, type);

        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory(registry);
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(registry);
        ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
        PropertyProcessor propertyProcessor = new PropertyProcessor(registry);
        JavaParameterImpl[] parameters = type.getConstructor().getParameters();
View Full Code Here


                                                                    String[].class,
                                                                    List.class,
                                                                    Set.class,
                                                                    String[].class);
        processor.visitConstructor(ctor1, type);
        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(registry);
        ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
        PropertyProcessor propertyProcessor = new PropertyProcessor(registry);
        JavaParameterImpl[] parameters = type.getConstructor().getParameters();
View Full Code Here

    public void checkDomain() throws NoSuchDomainException {
        NodeFactoryImpl nodeFactory = (NodeFactoryImpl)NodeFactory.newInstance(domainURI);
        try {
            nodeFactory.init();
           
            ExtensionPointRegistry extensionsRegistry = nodeFactory.getExtensionPointRegistry();
            Properties props = extensionsRegistry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties();
            props.setProperty("client", "true");
            DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(extensionsRegistry);
           
            String registryURI = domainURI;
View Full Code Here

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        NodeFactoryImpl nodeFactory = (NodeFactoryImpl)NodeFactory.newInstance(domainURI);
        try {
            nodeFactory.init();
           
            ExtensionPointRegistry extensionsRegistry = nodeFactory.getExtensionPointRegistry();
            Properties props = extensionsRegistry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties();
            props.setProperty("client", "true");
            DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(extensionsRegistry);
           
            String registryURI = domainURI;

            // TODO: theres better ways to do this but this gets things working for now
            if (registryURI.indexOf(":") == -1) {
                registryURI = "tuscanyclient:" + registryURI;
            }
            if (registryURI.startsWith("uri:")) {
                registryURI = "tuscanyclient:" + registryURI.substring(4);
            }
            if (registryURI.startsWith("tuscany:")) {
                registryURI = "tuscanyclient:" + registryURI.substring(8);
            }
           
            EndpointRegistry endpointRegistry;
            try {
                endpointRegistry = domainRegistryFactory.getEndpointRegistry(registryURI, domainURI);
            } catch (Exception e) {
                throw new NoSuchDomainException(domainURI, e);
            }
           
            FactoryExtensionPoint factories = extensionsRegistry.getExtensionPoint(FactoryExtensionPoint.class);
            AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
            JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
            ProxyFactory proxyFactory = new ExtensibleProxyFactory(extensionsRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class));

            String client = "sca.client." + UUID.randomUUID();
            CompositeContext compositeContext =
                new CompositeContext(extensionsRegistry, endpointRegistry, null, domainURI.toString(), client, nodeFactory.getDeployer().getSystemDefinitions());
View Full Code Here

    private static XMLInputFactory inputFactory;
    private static ProcessorContext context;
   
    @BeforeClass
    public static void setUp() throws Exception {
        ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
        context = new ProcessorContext(extensionPoints);
       
        FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
        outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
        //outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
        inputFactory = modelFactories.getFactory(XMLInputFactory.class);
       
        StAXArtifactProcessorExtensionPoint artifactProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
        compositeProcessor = artifactProcessors.getProcessor(Composite.class);
    }
View Full Code Here

        RuntimeEndpointReference epr = (RuntimeEndpointReference)assemblyFactory.createEndpointReference();
        epr.bind( compositeContext );
       
        // Create pseudo-reference
        ComponentReference reference = assemblyFactory.createComponentReference();
      ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
        JavaInterfaceFactory javaInterfaceFactory = (JavaInterfaceFactory)modelFactories.getFactory(JavaInterfaceFactory.class);
        JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
        try {
      interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(AsyncResponseHandler.class));
    } catch (InvalidInterfaceException e1) {
View Full Code Here

     * Gets a RuntimeAssemblyFactory from the CompositeContext
     * @param compositeContext
     * @return the RuntimeAssemblyFactory
     */
    private RuntimeAssemblyFactory getAssemblyFactory( CompositeContext compositeContext ) {
      ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
        return (RuntimeAssemblyFactory)modelFactories.getFactory(AssemblyFactory.class);
    } // end method RuntimeAssemblyFactory
View Full Code Here

    private InterfaceContractMapper mapper;
   
    @Before
    public void setUp() throws Exception {
        ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        mapper = utilities.getUtility(InterfaceContractMapper.class);
    }
View Full Code Here

* @version $Rev: 986740 $ $Date: 2010-08-18 16:28:56 +0100 (Wed, 18 Aug 2010) $
*/
public class BindingWSDLGeneratorTestCase extends TestCase {

    public void testCreateWSDLInterfaceContract() throws InvalidInterfaceException {
        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        org.apache.tuscany.sca.core.FactoryExtensionPoint modelFactories = new DefaultFactoryExtensionPoint(registry);
        WSDLFactory wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
        XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class);
        DocumentBuilderFactory documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class);
        JavaInterfaceFactory factory = new DefaultJavaInterfaceFactory(registry);
View Full Code Here

        } // end try
        endpoint.setComponent(fakeComponent);

        // Create pseudo-service
        ComponentService service = assemblyFactory.createComponentService();
        ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
        JavaInterfaceFactory javaInterfaceFactory =
            (JavaInterfaceFactory)modelFactories.getFactory(JavaInterfaceFactory.class);
        JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
        try {
            interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(AsyncResponseHandler.class));
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.ExtensionPointRegistry

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.