Package org.osgi.framework

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


                        } catch (Throwable t) {
                            // Check if the bundle can see the class
                            try {
                                PassThroughMetadata ptm = (PassThroughMetadata) componentDefinitionRegistry.getComponentDefinition("blueprintBundle");
                                Bundle b = (Bundle) ptm.getObject();
                                if (b.loadClass(LanguageResolver.class.getName()) != LanguageResolver.class) {
                                    throw new UnsupportedOperationException();
                                }
                                svc.setInterface(LanguageResolver.class.getName());
                            } catch (Throwable t2) {
                                throw new UnsupportedOperationException();
View Full Code Here


                        } catch (Throwable t) {
                            // Check if the bundle can see the class
                            try {
                                PassThroughMetadata ptm = (PassThroughMetadata) componentDefinitionRegistry.getComponentDefinition("blueprintBundle");
                                Bundle b = (Bundle) ptm.getObject();
                                if (b.loadClass(DataFormatResolver.class.getName()) != DataFormatResolver.class) {
                                    throw new UnsupportedOperationException();
                                }
                                svc.setInterface(DataFormatResolver.class.getName());
                            } catch (Throwable t2) {
                                throw new UnsupportedOperationException();
View Full Code Here

            } catch (Throwable t) {
                // Check if the bundle can see the class
                try {
                    PassThroughMetadata ptm = (PassThroughMetadata) componentDefinitionRegistry.getComponentDefinition("blueprintBundle");
                    Bundle b = (Bundle) ptm.getObject();
                    if (b.loadClass(DataFormatResolver.class.getName()) != DataFormatResolver.class) {
                        throw new UnsupportedOperationException();
                    }
                    svc.setInterface(DataFormatResolver.class.getName());
                } catch (Throwable t2) {
                    throw new UnsupportedOperationException();
View Full Code Here

            } catch (Throwable t) {
                // Check if the bundle can see the class
                try {
                    PassThroughMetadata ptm = (PassThroughMetadata) componentDefinitionRegistry.getComponentDefinition("blueprintBundle");
                    Bundle b = (Bundle) ptm.getObject();
                    if (b.loadClass(LanguageResolver.class.getName()) != LanguageResolver.class) {
                        throw new UnsupportedOperationException();
                    }
                    svc.setInterface(LanguageResolver.class.getName());
                } catch (Throwable t2) {
                    throw new UnsupportedOperationException();
View Full Code Here

            } catch (Throwable t) {
                // Check if the bundle can see the class
                try {
                    PassThroughMetadata ptm = (PassThroughMetadata) componentDefinitionRegistry.getComponentDefinition("blueprintBundle");
                    Bundle b = (Bundle) ptm.getObject();
                    if (b.loadClass(ComponentResolver.class.getName()) != ComponentResolver.class) {
                        throw new UnsupportedOperationException();
                    }
                    svc.setInterface(ComponentResolver.class.getName());
                } catch (Throwable t2) {
                    throw new UnsupportedOperationException();
View Full Code Here

    }
   
    private Bundle mockBundle() throws ClassNotFoundException
    {
        Bundle b = EasyMock.createMock(Bundle.class);
        EasyMock.expect(b.loadClass(String.class.getName())).andReturn((Class) String.class).anyTimes();
        EasyMock.expect(b.loadClass(Integer.class.getName())).andReturn((Class) Integer.class).anyTimes();
        EasyMock.replay(b);
        return b;
    }
   
View Full Code Here

   
    private Bundle mockBundle() throws ClassNotFoundException
    {
        Bundle b = EasyMock.createMock(Bundle.class);
        EasyMock.expect(b.loadClass(String.class.getName())).andReturn((Class) String.class).anyTimes();
        EasyMock.expect(b.loadClass(Integer.class.getName())).andReturn((Class) Integer.class).anyTimes();
        EasyMock.replay(b);
        return b;
    }
   
    public void testA1() throws Exception
View Full Code Here

//            Map credentialsNameMap = (Map) serviceRefCredentialsNameMap.get(name);
        String serviceInterfaceName = serviceRef.getServiceInterface();
        assureInterface(serviceInterfaceName, "javax.xml.rpc.Service", "[Web]Service", bundle);
        Class serviceInterface;
        try {
            serviceInterface = bundle.loadClass(serviceInterfaceName);
        } catch (ClassNotFoundException e) {
            throw new DeploymentException("Could not load service interface class: " + serviceInterfaceName, e);
        }
        URI wsdlURI = null;
        if (serviceRef.getWsdlFile() != null) {
View Full Code Here

            String portComponentLink = portComponentRef.getPortComponentLink();
            String serviceEndpointInterfaceType = portComponentRef.getServiceEndpointInterface();
            assureInterface(serviceEndpointInterfaceType, "java.rmi.Remote", "ServiceEndpoint", bundle);
            Class serviceEndpointClass;
            try {
                serviceEndpointClass = bundle.loadClass(serviceEndpointInterfaceType);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("could not load service endpoint class " + serviceEndpointInterfaceType, e);
            }
            portComponentRefMap.put(serviceEndpointClass, portComponentLink);
        }
View Full Code Here

            if (options.get(PASSWORD) != null) {
                properties.put("password", options.get(PASSWORD));
            }
            Bundle cl = (Bundle) options.get(JaasLoginModuleUse.CLASSLOADER_LM_OPTION);
            try {
                driver = (Driver) cl.loadClass((String) options.get(DRIVER)).newInstance();
            } catch (ClassNotFoundException e) {
                throw new IllegalArgumentException("Driver class " + options.get(
                        DRIVER) + " is not available.  Perhaps you need to add it as a dependency in your deployment plan?",
                        e);
            } catch (Exception e) {
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.