Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.ServicePoint


            ServiceImplementationFactoryParameters factoryParameters)
    {
        ServicePropertyFactoryParameter p = (ServicePropertyFactoryParameter) factoryParameters
                .getFirstParameter();

        ServicePoint targetServicePoint = p.getServicePoint();
        final Class targetServiceInterface = targetServicePoint.getServiceInterface();
    final Object targetService = targetServicePoint.getService( targetServiceInterface );
        String propertyName = p.getPropertyName();

        PropertyAdaptor pa = PropertyUtils.getPropertyAdaptor(targetService, propertyName);

        String readMethodName = pa.getReadMethodName();
View Full Code Here


     * @since 1.1
     */
    public void testDoubleStartup()
    {
        MockControl spc = newControl(ServicePoint.class);
        ServicePoint sp = (ServicePoint) spc.getMock();

        Runnable service = (Runnable) newMock(Runnable.class);

        // Training

        sp.getExtensionPointId();
        spc.setReturnValue("hivemind.Startup");

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

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

        sp.getService(Runnable.class);
        spc.setReturnValue(service);

        service.run();

        replayControls();
View Full Code Here

        while (i.hasNext())
        {
            if (following)
                buffer.append(", ");

            ServicePoint p = (ServicePoint) i.next();

            buffer.append(p.getExtensionPointId());

            following = true;
        }

        buffer.append("}");
View Full Code Here

    }

    public void createInterceptor(InterceptorStack stack, Module invokingModule, List parameters)
    {
        ServicePoint servicePoint = invokingModule.getServicePoint(stack
                .getServiceExtensionPointId());
        Set methods = getInterceptedMethods(stack, parameters);
        try
        {
            PerformanceCollector counter = createMBean(servicePoint, methods);
View Full Code Here

        return classFab.createClass();
    }

    private Class createInnerProxyClass(Class deferredProxyClass)
    {
        ServicePoint servicePoint = getServicePoint();

        Class serviceInterface = servicePoint.getServiceInterface();
        ProxyBuilder builder = new ProxyBuilder("InnerProxy", servicePoint);

        ClassFab classFab = builder.getClassFab();

        classFab.addField("_deferredProxy", deferredProxyClass);
View Full Code Here

    private synchronized void setup()
    {
        if (_factory == null)
        {
            ServicePoint factoryPoint = _contributingModule.getServicePoint(_factoryServiceId);

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

            Schema schema = factoryPoint.getParametersSchema();

            SchemaProcessorImpl processor = new SchemaProcessorImpl(factoryPoint.getErrorLog(),
                    schema);

            processor.process(_parameters, _contributingModule);

            _convertedParameters = processor.getElements();
View Full Code Here

    public void run()
    {
        Iterator i = _servicePoints.iterator();
        while (i.hasNext())
        {
            ServicePoint point = (ServicePoint) i.next();

            point.forceServiceInstantiation();
        }
    }
View Full Code Here

        {
            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,
View Full Code Here

    }

    public ServicePoint getServicePoint(String serviceId, Module module)
    {
        checkShutdown();
        ServicePoint result = (ServicePoint) _servicePoints.get(serviceId);
        if (result == null)
        {
            if (serviceId.indexOf('.') == -1)
            {
                final List possibleMatches = getMatchingServiceIds(serviceId);
                if (!possibleMatches.isEmpty())
                {
                    final StringBuffer sb = new StringBuffer();
                    for (Iterator i = possibleMatches.iterator(); i.hasNext();)
                    {
                        final String matching = (String) i.next();
                        sb.append('\"');
                        sb.append(matching);
                        sb.append('\"');
                        if (i.hasNext())
                        {
                            sb.append(", ");
                        }
                    }
                    throw new ApplicationRuntimeException(ImplMessages.unqualifiedServicePoint(
                            serviceId,
                            sb.toString()));
                }
            }
            throw new ApplicationRuntimeException(ImplMessages.noSuchServicePoint(serviceId));
        }

        if (!result.visibleToModule(module))
            throw new ApplicationRuntimeException(ImplMessages.serviceNotVisible(serviceId, module));

        return result;
    }
View Full Code Here

    private List getMatchingServiceIds(String serviceId)
    {
        final List possibleMatches = new LinkedList();
        for (Iterator i = _servicePoints.values().iterator(); i.hasNext();)
        {
            final ServicePoint servicePoint = (ServicePoint) i.next();
            if (servicePoint.getExtensionPointId().equals(
                    servicePoint.getModule().getModuleId() + "." + serviceId))
            {
                possibleMatches.add(servicePoint.getExtensionPointId());
            }
        }
        return possibleMatches;
    }
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.