Package org.apache.tuscany.model.assembly

Examples of org.apache.tuscany.model.assembly.EntryPoint


        return createEntryPoint(entryPointName, configuredService, binding, configuredReference);
    }

    public EntryPoint createEntryPoint(String entryPointName, ConfiguredService configuredService, Binding binding, ConfiguredReference configuredReference) {
        EntryPoint entryPoint = createEntryPoint();
        entryPoint.setName(entryPointName);
        entryPoint.setConfiguredService(configuredService);
        entryPoint.setConfiguredReference(configuredReference);
        entryPoint.getBindings().add((Binding)binding);
        return entryPoint;
    }
View Full Code Here


    public static CompositeContext createModuleWithJSONRPCEntryPoint(String entryPointName, Object instance) {
        MockCompositeContextImpl cci = new MockCompositeContextImpl();
        Module module = (Module) cci.getComposite();
        List<EntryPoint> entryPoints = module.getEntryPoints();
        EntryPoint ep = createMockEntryPoint(entryPointName);
        addJSONRPCBinding(ep);
        entryPoints.add(ep);
        cci.start();

        Map<String, Context> ics = new HashMap<String, Context>();
View Full Code Here

        return cci;
    }

    public static EntryPoint createMockEntryPoint(String name) {
        EntryPoint entryPoint = new EntryPointImpl() {
        };
        entryPoint.setName(name);
        return entryPoint;
    }
View Full Code Here

                    registerAutowire((ModuleComponent) component);
                } else {
                    registerAutowire(component);
                }
            } else if (model instanceof EntryPoint) {
                EntryPoint ep = (EntryPoint) model;
                module.getEntryPoints().add(ep);
                configuration = (ContextFactory<Context>) ep.getContextFactory();
                if (configuration == null) {
                    ConfigurationException e = new MissingContextFactoryException("Context factory not set");
                    e.setIdentifier(ep.getName());
                    e.addContextName(getName());
                    throw e;
                }
                registerConfiguration(configuration);
                registerAutowire(ep);
View Full Code Here

        this.messageFactory = msgFactory;
    }

    public void build(AssemblyObject object) throws BuilderException {
        if (object instanceof EntryPoint) {
            EntryPoint ep = (EntryPoint) object;
            if (ep.getBindings().size() < 1 || !(ep.getBindings().get(0) instanceof FooBinding)) {
                return;
            }
            EntryPointContextFactory contextFactory = new FooEntryPointContextFactory(ep.getName(), messageFactory);
            ConfiguredService configuredService = ep.getConfiguredService();
            Service service = configuredService.getPort();
            SourceWireFactory wireFactory = wireFactoryService.createSourceFactory(ep.getConfiguredReference()).get(0);
            contextFactory.addSourceWireFactory(service.getName(), wireFactory);
            ep.setContextFactory(contextFactory);
        } else if (object instanceof ExternalService) {
            ExternalService es = (ExternalService) object;
            if (es.getBindings().size() < 1 || !(es.getBindings().get(0) instanceof FooBinding)) {
                return;
            }
View Full Code Here

    public void build(AssemblyObject object) throws BuilderException {
        if (!(object instanceof EntryPoint)) {
            return;
        }
        EntryPoint entryPoint = (EntryPoint) object;
        if (entryPoint.getBindings().size() < 1) {
            return;
        }
        if (!bindingClass.isAssignableFrom(entryPoint.getBindings().get(0).getClass())) {
            return;
        }

        EntryPointContextFactory contextFactory = createEntryPointContextFactory(entryPoint, messageFactory);
        ConfiguredService configuredService = entryPoint.getConfiguredService();
        Service service = configuredService.getPort();
        SourceWireFactory wireFactory = wireService.createSourceFactory(entryPoint.getConfiguredReference()).get(0);
        contextFactory.addSourceWireFactory(service.getName(), wireFactory);
        entryPoint.setContextFactory(contextFactory);
    }
View Full Code Here

            component.getImplementation().setComponentType(introspector.introspect(impl));
        } catch (ConfigurationException e) {
            throw (AssertionError) new AssertionError("Invalid bootstrap loader").initCause(e);
        }

        EntryPoint entryPoint = factory.createSystemEntryPoint(epName, service, compName);

        module.getComponents().add(component);
        module.getEntryPoints().add(entryPoint);
    }
View Full Code Here

                    configuredReference = ((Component) part).getConfiguredReference(referenceName);
                } else if (part instanceof EntryPoint) {
                    configuredReference = ((EntryPoint) part).getConfiguredReference();
                }
            } else {
                EntryPoint entryPoint = (EntryPoint) getPart(partName);
                if (entryPoint != null) {
                    configuredReference = entryPoint.getConfiguredReference();
                }
            }
            if (configuredReference == null) {
                throw new IllegalArgumentException("Cannot find wire source " + sourceURI.getPath());
            } else {
View Full Code Here

    /**
     * Creates an entry point with the given name configured with the given interface and the {@link
     * FooBinding}
     */
    public static EntryPoint createFooBindingEntryPoint(String name, Class interfaz) {
        EntryPoint ep = factory.createEntryPoint();
        ep.setName(name);
        Service s = factory.createService();
        JavaServiceContract ji = factory.createJavaServiceContract();
        ji.setScope(Scope.MODULE);
        ji.setInterface(interfaz);
        s.setServiceContract(ji);
        ConfiguredService configuredService = factory.createConfiguredService();
        configuredService.setPort(s);
        ep.setConfiguredService(configuredService);
        FooBinding binding = new FooBinding();
        ep.getBindings().add(binding);
        return ep;
    }
View Full Code Here

        ref.setServiceContract(inter);
        cref.setPort(ref);
        cref.getTargetConfiguredServices().add(cTargetService);
        cref.initialize(assemblyContext);

        EntryPoint sourceEP = createFooBindingEntryPoint("source", HelloWorldService.class);
        sourceEP.setConfiguredReference(cref);
        sourceEP.getConfiguredService().getPort().setName("HelloWorldService");
        sourceEP.initialize(assemblyContext);

        Module module = factory.createModule();
        module.setName("test.module");
        module.getEntryPoints().add(sourceEP);
        module.getComponents().add(targetComponent);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.model.assembly.EntryPoint

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.