Package org.osgi.framework

Examples of org.osgi.framework.Bundle.start()


            }
        }

        if ( doStart )
        {
            bundle.start();
        }

        return bundle;
    }
}
View Full Code Here


                if ( "start".equals( action ) )
                {
                    // start bundle
                    try
                    {
                        bundle.start();
                    }
                    catch ( BundleException be )
                    {
                        bundleException = be;
                        log( "Cannot start", be );
View Full Code Here

        Bundle bundle = getHttpJettyBundle();
        // Restart the HTTP-service to clean all registrations...
        if (bundle.getState() == Bundle.ACTIVE)
        {
            bundle.stop();
            bundle.start();
        }
    }

    /**
     * Waits for a service to become available in certain time interval.
View Full Code Here

        {
            Mockito.when( dl.loadDriver( Mockito.eq( string ) ) ).thenReturn( null );
            Bundle bundle = Mockito.mock( Bundle.class );
           
            Mockito.when( m_context.installBundle( "_DD_" + string, null ) ).thenReturn( bundle );
            bundle.start();
           
            ServiceReference ref = Mockito.mock( ServiceReference.class );
            Mockito.when( ref.getProperty( Constants.DRIVER_ID ) ).thenReturn( string );
            Mockito.when( bundle.getRegisteredServices() ).thenReturn( new ServiceReference[]
                { ref } );
View Full Code Here

        final String groupName = "testGroup";

        UserAdmin userAdmin = awaitService(UserAdmin.class.getName());
        Bundle fileStoreBundle = getFileStoreBundle();
        // Start a suitable storage service...
        fileStoreBundle.start();

        // Fill the user admin with some data...
        User testUser = (User) userAdmin.createRole(userName, Role.USER);
        testUser.getProperties().put("key", "value");
View Full Code Here

        // Verify the user + group are gone (no store available)...
        assertNull(userAdmin.getRole(userName));
        assertNull(userAdmin.getRole(groupName));

        // Start the file store...
        fileStoreBundle.start();

        // Verify the user + group are gone (no store available)...
        User readUser = (User) userAdmin.getRole(userName);
        assertNotNull(readUser);
        assertEquals(userName, readUser.getName());
View Full Code Here

        final String groupName = "anotherTestGroup";

        UserAdmin userAdmin = awaitService(UserAdmin.class.getName());
        Bundle fileStoreBundle = getFileStoreBundle();
        // Start a suitable storage service...
        fileStoreBundle.start();

        // Fill the user admin with some data...
        User testUser = (User) userAdmin.createRole(userName, Role.USER);
        testUser.getProperties().put("key", "value");
View Full Code Here

        // Obtain user admin service again; shouldn't be available...
        userAdmin = getService(UserAdmin.class.getName());
        assertNull(userAdmin);

        userAdminBundle.start();

        // Obtain user admin service again; should be available now...
        userAdmin = awaitService(UserAdmin.class.getName());
        assertNotNull(userAdmin);
View Full Code Here

    public void testStoreIsInitializedAndClosedProperlyOk() throws Exception
    {
        UserAdmin ua = getUserAdmin();
        // Start the file store bundle...
        Bundle fileStoreBundle = getFileStoreBundle();
        fileStoreBundle.start();

        // Create two roles...
        User user = (User) ua.createRole("user1", Role.USER);
        assertNotNull(user);
View Full Code Here

        assertNull(group);

        // This will not succeed: no backend to store the user in...
        assertNull(ua.createRole("user2", Role.USER));

        fileStoreBundle.start();

        awaitService(ORG_APACHE_FELIX_USERADMIN_FILESTORE);

        // Retrieve the roles again; should both yield valid values...
        user = (User) ua.getRole("user1");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.