Package com.volantis.osgi.cm.service

Examples of com.volantis.osgi.cm.service.ManagedServiceHandler


        // =====================================================================
        //   Test Expectations
        // =====================================================================

        ServiceHandler serviceHandler = new ManagedServiceHandler(manager);

        // Register a ManagedService before a suitable configuration
        // has been created.
        serviceHandler.serviceRegistered(unauthorizedServiceReferenceMock);

        // Attempt to register another factory for the same pid from a
        // different bundle. This should fail and log a warning. Then make sure
        // that the other service listener events do not fail.
        serviceHandler.serviceRegistered(attackingServiceReferenceMock);
        serviceHandler.serviceModified(attackingServiceReferenceMock);
        serviceHandler.serviceUnregistering(attackingServiceReferenceMock);

        // Create the configuration.
        Configuration c1 =
                unauthorizedAdmin.getConfiguration(SERVICE_PID1);
        c1.update(new Hashtable());

        // Check to see if the information has been correctly persisted.
        checkPersistedConfigurations(
                new InternalConfiguration[]{
                        new ConfigurationImpl(SERVICE_PID1, null, null,
                                UNAUTHORIZED_BUNDLE_LOCATION,
                                new CaseInsensitiveDictionary()),
                });

        // Delete the configuration.
        c1.delete();

        // Create a free configuration.
        c1 = authorizedAdmin.getConfiguration(SERVICE_PID1, null);
        c1.update(new Hashtable());
        checkLocationBinding(SERVICE_PID1, UNAUTHORIZED_BUNDLE_LOCATION);

        // The ManagedService service has changed.
        serviceHandler.serviceModified(unauthorizedServiceReferenceMock);

        // The ManagedService service has unregistered.
        serviceHandler.serviceUnregistering(unauthorizedServiceReferenceMock);

        // Make sure that the configurations that were created without any
        // specific bundle location and have not since been deleted have
        // reverted to null.
        checkLocationBinding(SERVICE_PID1, null);

        // Reregister another ManagedServiceFactory with the same PID but from
        // a different bundle.
        serviceHandler.serviceRegistered(attackingServiceReferenceMock);

        // Check to see if the information has been correctly persisted.
        checkPersistedConfigurations(
                new InternalConfiguration[]{
                        new ConfigurationImpl(SERVICE_PID1, null, null,
View Full Code Here


            BundleContext bundleContext,
            ConfigurationManager manager,
            PluginManager pluginManager) {

        serviceHandlers = new ServiceHandler[]{
                new ManagedServiceHandler(manager),
                new ManagedServiceFactoryHandler(manager),
                new ConfigurationPluginHandler(pluginManager)
        };

        // Create a filter that will only select those services that are of the
View Full Code Here

TOP

Related Classes of com.volantis.osgi.cm.service.ManagedServiceHandler

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.