Package org.apache.hivemind.parse

Examples of org.apache.hivemind.parse.ServicePointDescriptor


    public void testPrivateServicePoint() throws Exception
    {
        ModuleDescriptor md = parse("PrivateServicePoint.xml");

        List points = md.getServicePoints();
        ServicePointDescriptor spd = (ServicePointDescriptor) points.get(0);

        assertEquals(Visibility.PRIVATE, spd.getVisibility());
    }
View Full Code Here


        List services = md.getServicePoints();
        int count = size(services);

        for (int i = 0; i < count; i++)
        {
            ServicePointDescriptor sd = (ServicePointDescriptor) services.get(i);

            String pointId = moduleId + "." + sd.getId();

            if (LOG.isDebugEnabled())
                LOG.debug("Creating service extension point: " + pointId);

            // Choose which class to instantiate based on
            // whether the service is create-on-first-reference
            // or create-on-first-use (deferred).

            ServicePointImpl point = new ServicePointImpl();

            point.setExtensionPointId(pointId);
            point.setLocation(sd.getLocation());
            point.setModule(module);

            point.setServiceInterfaceName(sd.getInterfaceClassName());
            point.setParametersSchema(sd.getParametersSchema());

            point.setShutdownCoordinator(_shutdownCoordinator);

            registry.addServicePoint(point);
View Full Code Here

     * Convenience method for creating a {@link ServicePointDescriptor}.
     */
    protected ServicePointDescriptor createServicePointDescriptor(String pointId,
            Class serviceInterface)
    {
        ServicePointDescriptor result = new ServicePointDescriptor();

        result.setId(pointId);
        result.setInterfaceClassName(serviceInterface.getName());
        result.setLocation(newLocation());

        return result;
    }
View Full Code Here

    {
        ModuleDescriptor md = parse("GenericModule.xml");

        List l = md.getServicePoints();
        assertEquals(2, l.size());
        ServicePointDescriptor spd = (ServicePointDescriptor) l.get(0);

        assertEquals("MyService1", spd.getId());
        assertEquals("package.MyService", spd.getInterfaceClassName());

        CreateInstanceDescriptor cid = (CreateInstanceDescriptor) spd.getInstanceBuilder();
        assertEquals("package.impl.MyServiceImpl", cid.getInstanceClassName());

        l = spd.getInterceptors();
        assertEquals(2, l.size());

        InterceptorDescriptor id = (InterceptorDescriptor) l.get(0);
        assertEquals("MyInterceptor", id.getFactoryServiceId());
        assertEquals("OtherInterceptor", id.getBefore());
View Full Code Here

    public void testParametersSchema() throws Exception
    {
        ModuleDescriptor md = parse("GenericModule.xml");
        List l = md.getServicePoints();
        assertEquals(2, l.size());
        ServicePointDescriptor spd = (ServicePointDescriptor) l.get(1);

        String schemaId = spd.getParametersSchemaId();

        assertEquals("Parameters", schemaId);

        ElementModel em = (ElementModel) md.getSchema(schemaId).getElementModel().get(0);
View Full Code Here

        ModuleDescriptor md = parse("DuplicateSchemas.xml");

        assertLoggedMessagePattern("Multiple parameters schemas specified for service MyServiceFactory. Using locally defined schema \\(at ");

        ServicePointDescriptor spd = (ServicePointDescriptor) md.getServicePoints().get(0);
        Schema nestedSchema = spd.getParametersSchema();

        assertNotNull(nestedSchema);

        ElementModel em = (ElementModel) nestedSchema.getElementModel().get(0);
View Full Code Here

    public void testEmbeddedParametersSchema() throws Exception
    {
        ModuleDescriptor md = parse("EmbeddedParametersSchema.xml");

        List points = md.getServicePoints();
        ServicePointDescriptor spd = (ServicePointDescriptor) points.get(0);
        Schema s = spd.getParametersSchema();

        List l = s.getElementModel();

        assertEquals(1, l.size());
View Full Code Here

    public void testPrivateServicePoint() throws Exception
    {
        ModuleDescriptor md = parse("PrivateServicePoint.xml");

        List points = md.getServicePoints();
        ServicePointDescriptor spd = (ServicePointDescriptor) points.get(0);

        assertEquals(Visibility.PRIVATE, spd.getVisibility());
    }
View Full Code Here

    public void testInterfaceNameQualifiedToModulePackage() throws Exception
    {
        ModuleDescriptor md = parse("InterfaceNameQualifiedToModulePackage.xml");

        ServicePointDescriptor spd = (ServicePointDescriptor) md.getServicePoints().get(0);

        assertEquals("my.package.MyServiceInterface", spd.getInterfaceClassName());
    }
View Full Code Here

    public void testNoInterface() throws Exception
    {
        ModuleDescriptor md = parse("NoInterface.xml");

        ServicePointDescriptor spd = (ServicePointDescriptor) md.getServicePoints().get(0);

        assertEquals("hivemind.test.NoInterface", spd.getInterfaceClassName());
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.parse.ServicePointDescriptor

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.