Package org.apache.hivemind.parse

Examples of org.apache.hivemind.parse.ServicePointDescriptor


        if (servicePoints != null)
        {
            for (Iterator i = servicePoints.iterator(); i.hasNext();)
            {
                ServicePointDescriptor spd = (ServicePointDescriptor) i.next();

                Element servicePoint = getServicePointElement(spd);

                module.appendChild(servicePoint);

                SchemaImpl s = (SchemaImpl) spd.getParametersSchema();

                if (s != null && s.getId() != null)
                    addSchema(module, s, "schema");
            }
        }
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();

            ServicePoint existingPoint = (ServicePoint) _servicePoints.get(pointId);

            if (existingPoint != null)
            {
                _errorHandler.error(_log, ImplMessages.duplicateExtensionPointId(
                        pointId,
                        existingPoint), sd.getLocation(), null);
                continue;
            }

            if (_log.isDebugEnabled())
                _log.debug("Creating service 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(findSchema(sd.getParametersSchema(), module, sd
                    .getParametersSchemaId(), point.getLocation()));

            point.setParametersCount(sd.getParametersCount());
            point.setVisibility(sd.getVisibility());

            point.setShutdownCoordinator(_shutdownCoordinator);

            infrastructure.addServicePoint(point);
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();

            ServicePoint existingPoint = (ServicePoint) _servicePoints.get(pointId);

            if (existingPoint != null)
            {
                _errorHandler.error(_log, ImplMessages.duplicateExtensionPointId(
                        pointId,
                        existingPoint), sd.getLocation(), null);
                continue;
            }

            if (_log.isDebugEnabled())
                _log.debug("Creating service 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(findSchema(sd.getParametersSchema(), module, sd
                    .getParametersSchemaId(), point.getLocation()));

            point.setParametersCount(sd.getParametersCount());
            point.setVisibility(sd.getVisibility());

            point.setShutdownCoordinator(_shutdownCoordinator);

            infrastructure.addServicePoint(point);
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.setParametersCount(sd.getParametersCount());

            point.setShutdownCoordinator(_shutdownCoordinator);

            registry.addServicePoint(point);
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

        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();

            ServicePoint existingPoint = (ServicePoint) _servicePoints.get(pointId);

            if (existingPoint != null)
            {
                _errorHandler.error(_log, ImplMessages.duplicateExtensionPointId(
                        pointId,
                        existingPoint), sd.getLocation(), null);
                continue;
            }

            if (_log.isDebugEnabled())
                _log.debug("Creating service 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());
            setParametersSchema(sd, point);
            point.setParametersCount(sd.getParametersCount());
            point.setVisibility(sd.getVisibility());

            point.setShutdownCoordinator(_shutdownCoordinator);

            infrastructure.addServicePoint(point);
View Full Code Here

        if (servicePoints != null)
        {
            for (Iterator i = servicePoints.iterator(); i.hasNext();)
            {
                ServicePointDescriptor spd = (ServicePointDescriptor) i.next();

                Element servicePoint = getServicePointElement(spd);

                module.appendChild(servicePoint);

                SchemaImpl s = (SchemaImpl) spd.getParametersSchema();

                if (s != null && s.getId() != null)
                    addSchema(module, s, "schema");
            }
        }
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.