Package org.osgi.service.component

Examples of org.osgi.service.component.ComponentException


   
    private static Object firstCollectionElement( Object raw, Object defaultValue )
    {
        if (!(raw instanceof Collection))
        {
            throw new ComponentException("Not a collection: " + raw);
        }
        Collection<?> c = ( Collection<?> ) raw;
        if (c.isEmpty())
        {
            return defaultValue;
View Full Code Here


    }

    private static Object firstArrayElement(Object o, Object defaultValue)
    {
        if (o == null || !o.getClass().isArray()) {
            throw new ComponentException("Not an array: " + o);
        }
        if (Array.getLength( o ) == 0)
        {
            return defaultValue;
        }
View Full Code Here

                }
                buf.append( " as Component of Class " ).append( cMeta.getImplementationClassName() );
                message = buf.toString();
            }

            throw new ComponentException( message );
        }

        return key;
    }
View Full Code Here

        {
            // only register the component if there is a m_registration for it !
            if ( m_componentHoldersByName.get( key ) != null )
            {
                // this is not expected if all works ok
                throw new ComponentException( "The component name '{0}" + componentHolder.getComponentMetadata().getName()
                    + "' has already been registered." );
            }

            m_componentHoldersByName.put( key, componentHolder );
        }
View Full Code Here

        if ( m_name == null )
        {
            // 112.4.3 name is optional defaulting to implementation class name since DS 1.1
            if ( !m_dsVersion.isDS11() )
            {
                throw new ComponentException( "The component name has not been set" );
            }
            setName( getImplementationClassName() );
        }

        // 112.10 There must be one implementation element and the class atribute is required
View Full Code Here

     *
     * @param reason The explanation for failing to validate this component.
     */
    ComponentException validationFailure( String reason )
    {
        return new ComponentException( "Component " + getName() + " validation failed: " + reason );
    }
View Full Code Here

        // Get the Metadata-Location value from the manifest
        String descriptorLocations = ( String ) m_bundle.getHeaders().get( "Service-Component" );
        if ( descriptorLocations == null )
        {
            throw new ComponentException( "Service-Component entry not found in the manifest" );
        }

        initialize( descriptorLocations );
    }
View Full Code Here

          instance = cm.getComponentInstance();
          if ( instance == null ||  instance.getInstance() == null )
          {
            // activation failed, clean up component manager
            cm.dispose( ComponentConstants.DEACTIVATION_REASON_DISPOSED );
            throw new ComponentException( "Failed activating component" );
          }
        }

        synchronized ( m_componentInstances )
        {
View Full Code Here

        // create factory
        SimpleDeviceRepositoryFactory factory = new SimpleDeviceRepositoryFactory();
        try {
            repository = factory.createDeviceRepository(repositoryUrl);
        } catch (DeviceRepositoryException e) {
            throw new ComponentException(exceptionLocalizer.format("repository-not-accessible"));
        }

        if (repository == null) {
            throw new ComponentException(exceptionLocalizer.format("repository-not-accessible"));
        }
    }
View Full Code Here

                }
                buf.append( " as Component of Class " ).append( cMeta.getImplementationClassName() );
                message = buf.toString();
            }

            throw new ComponentException( message );
        }

        return key;
    }
View Full Code Here

TOP

Related Classes of org.osgi.service.component.ComponentException

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.