Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.ServicePoint


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

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

            Schema schema = factoryPoint.getParametersSchema();

            SchemaProcessorImpl processor =
                new SchemaProcessorImpl(_contributingModule.getErrorHandler(), schema);

            processor.process(_parameters, _contributingModule);
View Full Code Here


    public ServicePoint getServicePoint(String serviceId)
    {
        checkShutdown();

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

        if (result == null)
            throw new ApplicationRuntimeException(ImplMessages.noSuchServicePoint(serviceId));

        return result;
View Full Code Here

        return result;
    }

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

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

        if (servicePoints.size() > 1)
            throw new ApplicationRuntimeException(
                ImplMessages.multipleServicePointsForInterface(serviceInterface, servicePoints));

        ServicePoint sp = (ServicePoint) servicePoints.get(0);

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

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

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

        if (point == null)
            return false;

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

    {
        Log serviceLog = _serviceExtensionPoint.getServiceLog();

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

            Occurances expected = factoryPoint.getParametersCount();

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

            Schema schema = factoryPoint.getParametersSchema();

            // Note: it's kind of a toss up whether logging should occur using the
            // id of the service being constructed, or of the factory being invoked.
            // Here, we're using the constructed service ... with the intent being that
            // users will enable debugging for the service (or search the logs for the service)
View Full Code Here

    public void testServicePointTranslator()
    {
        MockControl control = newControl(Module.class);
        Module m = (Module) control.getMock();

        ServicePoint sp = new ServicePointImpl();

        m.getServicePoint("Fred");
        control.setReturnValue(sp);

        replayControls();

        Translator t = new ServicePointTranslator();

        ServicePoint result = (ServicePoint) t.translate(m, null, "Fred", null);

        assertSame(sp, result);

        verifyControls();
    }
View Full Code Here

    public void testEagerLoaderImpl()
    {
        EagerLoader el = new EagerLoader();
        List l = new ArrayList();

        ServicePoint sp = (ServicePoint) newMock(ServicePoint.class);

        sp.forceServiceInstantiation();
  
    replayControls();

        l.add(sp);
View Full Code Here

    }

    public void testInvokeFactoryServiceConstructorAccessors()
    {
        Module m = new ModuleImpl();
        ServicePoint sep = new ServicePointImpl();
        List p = new ArrayList();
        InvokeFactoryServiceConstructor c = new InvokeFactoryServiceConstructor();

        c.setContributingModule(m);
        c.setServiceExtensionPoint(sep);
View Full Code Here

        LoggingInterceptorFactory f = new LoggingInterceptorFactory();
        f.setFactory(cf);

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

        MockControl moduleControl = newControl(Module.class);
        Module module = (Module) moduleControl.getMock();

        // Training

        sp.getServiceInterface();
        spControl.setReturnValue(Runnable.class);
       
        sp.getModule();
        spControl.setReturnValue(module);
       
        module.getClassResolver();
        moduleControl.setReturnValue(new DefaultClassResolver());

       
        sp.getExtensionPointId();
        spControl.setReturnValue("foo.bar");
       
        replayControls();

        InterceptorStackImpl is = new InterceptorStackImpl(log, sp, r);
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.