Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.ServicePoint


    public List getServiceIds(Class serviceInterface)
    {
        final List serviceIds = new LinkedList();
        for( Iterator i = _servicePoints.values().iterator(); i.hasNext(); )
        {
            final ServicePoint servicePoint = ( ServicePoint )i.next();
           
            if( servicePoint.getServiceInterface().equals( serviceInterface ) && servicePoint.visibleToModule( null ) )
            {
                serviceIds.add( servicePoint.getExtensionPointId() );
            }
           
        }
        return serviceIds;
    }
View Full Code Here


    {
        Registry registry = buildFrameworkRegistry("testMBeanRegistry.xml");
        List mBeanList = registry.getConfiguration("hivemind.management.MBeans");

        // Training
        ServicePoint sp1 = ((MBeanRegistrationContribution) mBeanList.get(0)).getServicePoint();
        Object mBean1 = registry.getService("test.management.MBean1", Runnable.class);
        ObjectName on1 = objectNameBuilder.createServiceObjectName(sp1);
        server.registerMBean(mBean1, on1);
        ObjectInstance oin1 = new ObjectInstance(on1, mBean1.getClass().getName());
        serverControl.setReturnValue(oin1);
View Full Code Here

    public void testRegistrationException() throws Exception
    {
        Registry registry = buildFrameworkRegistry("testMBeanRegistry.xml");
        List mBeanList = registry.getConfiguration("hivemind.management.MBeans");

        ServicePoint sp1 = ((MBeanRegistrationContribution) mBeanList.get(0)).getServicePoint();
        ObjectName on1 = objectNameBuilder.createServiceObjectName(sp1);

        // Training
        server.registerMBean(null, null);
        serverControl.setThrowable(new MBeanRegistrationException(new Exception(
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

    }

    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

    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 run()
    {
        Iterator i = _servicePoints.iterator();
        while (i.hasNext())
        {
            ServicePoint point = (ServicePoint) i.next();

            point.forceServiceInstantiation();
        }
    }
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(_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

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.