Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.ServicePoint


        return possibleMatches;
    }

    public Object getService(String serviceId, Class serviceInterface, Module module)
    {
        ServicePoint point = getServicePoint(serviceId, module);

        return point.getService(serviceInterface);
    }
View Full Code Here


        List servicePoints = (List) _servicePointsByInterfaceClassName.get(key);

        if (servicePoints == null)
            servicePoints = Collections.EMPTY_LIST;

        ServicePoint point = null;
        int count = 0;

        Iterator i = servicePoints.iterator();
        while (i.hasNext())
        {
            ServicePoint sp = (ServicePoint) i.next();

            if (!sp.visibleToModule(module))
                continue;

            point = sp;

            count++;
View Full Code Here

        int count = 0;

        Iterator i = servicePoints.iterator();
        while (i.hasNext())
        {
            ServicePoint point = (ServicePoint) i.next();

            if (point.visibleToModule(module))
                count++;
        }

        return count == 1;
    }
View Full Code Here

    public boolean containsService(String serviceId, Class serviceInterface, Module module)
    {
        checkShutdown();

        ServicePoint point = (ServicePoint) _servicePoints.get(serviceId);

        if (point == null)
            return false;

        return point.visibleToModule(module)
                && point.getServiceInterface().equals(serviceInterface);
    }
View Full Code Here

        checkShutdown();

        String serviceId = token.getServiceId();

        ServicePoint sp = (ServicePoint) _servicePoints.get(serviceId);

        return sp.getService(Object.class);
    }
View Full Code Here

    public Module getModule(String moduleId)
    {
        for (Iterator i = _servicePoints.values().iterator(); i.hasNext();)
        {
            final ServicePoint servicePoint = (ServicePoint) i.next();

            if (servicePoint.getModule().getModuleId().equals(moduleId))
            {
                return servicePoint.getModule();
            }
        }
        return null;
    }
View Full Code Here

        {
            return serviceIds;
        }
        for (Iterator i = _servicePoints.values().iterator(); i.hasNext();)
        {
            final ServicePoint servicePoint = (ServicePoint) i.next();

            if (serviceInterface.getName().equals( servicePoint.getServiceInterfaceClassName() )
                    && servicePoint.visibleToModule(null))
            {
                serviceIds.add(servicePoint.getExtensionPointId());
            }

        }
        return serviceIds;
    }
View Full Code Here

    public Object constructCoreServiceImplementation()
    {
        if (_factory == null)
        {
            ServicePoint factoryPoint = _contributingModule.getServicePoint(_factoryServiceId);

            Occurances expected = factoryPoint.getParametersCount();

            _factory = (ServiceImplementationFactory) factoryPoint
                    .getService(ServiceImplementationFactory.class);

            Schema schema = factoryPoint.getParametersSchema();

            ErrorLog errorLog = _serviceExtensionPoint.getErrorLog();

            SchemaProcessorImpl processor = new SchemaProcessorImpl(errorLog, schema);
View Full Code Here

    public void testGetServiceNotVisibleToApplication()
    {
        RegistryInfrastructureImpl rf = new RegistryInfrastructureImpl(null, null);

        MockControl spc = newControl(ServicePoint.class);
        ServicePoint sp = (ServicePoint) spc.getMock();

        // Training

        sp.getExtensionPointId();
        spc.setReturnValue("foo.bar.Baz");

        sp.getServiceInterfaceClassName();
        spc.setReturnValue(Runnable.class.getName());

        sp.visibleToModule(null);
        spc.setReturnValue(false);

        replayControls();

        rf.addServicePoint(sp);
View Full Code Here

    public void testGetServiceNotVisibleToModule()
    {
        RegistryInfrastructureImpl rf = new RegistryInfrastructureImpl(null, null);

        MockControl spc = newControl(ServicePoint.class);
        ServicePoint sp = (ServicePoint) spc.getMock();

        ModuleImpl m = new ModuleImpl();
        m.setModuleId("zip.zap.Zoom");

        // Training

        sp.getExtensionPointId();
        spc.setReturnValue("foo.bar.Baz");

        sp.getServiceInterfaceClassName();
        spc.setReturnValue(Runnable.class.getName());

        sp.visibleToModule(m);
        spc.setReturnValue(false);

        replayControls();

        rf.addServicePoint(sp);
View Full Code Here

TOP

Related Classes of org.apache.hivemind.internal.ServicePoint

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.