Examples of ComponentException


Examples of org.osgi.service.component.ComponentException

        {
            // 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

Examples of org.osgi.service.component.ComponentException

        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

Examples of org.osgi.service.component.ComponentException

     *
     * @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

Examples of org.osgi.service.component.ComponentException

        // 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

Examples of org.osgi.service.component.ComponentException

          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

Examples of org.pentaho.platform.api.engine.ComponentException

    if ( ( resultSet != null ) && ( resultSet.getRowCount() > 0 ) ) {
      displayNames = new HashMap();
      items = new ArrayList();
      if ( nameColumnNo == -1 ) {
        // we did not find the specified name column
        throw new ComponentException( Messages.getInstance().getErrorString(
            "FilterDefinition.ERROR_0001_NAME_COLUMN_MISSING", descriptionItem ) ); //$NON-NLS-1$
      } else if ( valueColumnNo == -1 ) {
        // we did not find the specified name column
        throw new ComponentException( Messages.getInstance().getErrorString(
            "FilterDefinition.ERROR_0002_VALUE_COLUMN_MISSING", valueItem ) ); //$NON-NLS-1$
      }

      Object[] row = null;
      try {
        row = resultSet.next();
      } catch ( Exception e ) {
        // We will check for null below
      }
      if ( row == null ) {
        logger.warn( Messages.getInstance().getErrorString( "FilterDefinition.ERROR_0004_FILTER_DEFINITION_EMPTY" ) ); //$NON-NLS-1$
      } else {
        while ( row != null ) {
          value = row[valueColumnNo].toString();
          items.add( value );
          name = row[nameColumnNo].toString();
          if ( name != null ) {
            displayNames.put( value, name );
          }

          row = resultSet.next();
        }
      }
      // close the result set so we can loop through it again later if we need
      // to
      resultSet.close();

      // now create the XForm for the item
      if ( displayNames.size() == 0 ) {
        displayNames = null;
      }
    } else {
      // ResultSet is null and it is ok only for a filter type of TEXT_BOX
      if ( type != XForm.TYPE_TEXT ) {
        throw new ComponentException( Messages.getInstance().getErrorString(
            "FilterDefinition.ERROR_0003_FILTER_DEFINITION_NULL" ) ); //$NON-NLS-1$
      }
    }

    assert formName != null : Messages.getInstance().getErrorString( "FilterDefinition.ERROR_0005_NAME_ELEMENT_EMPTY" ); //$NON-NLS-1$
View Full Code Here

Examples of org.xmpp.component.ComponentException

                        StreamError error = new StreamError(doc);
                        // Close the connection
                        socket.close();
                        socket = null;
                        // throw the exception with the wrapped error
                        throw new ComponentException(error);
                    }
                    // Everything went fine
                    // Start keep alive thread to send every 30 seconds of inactivity a heart beat
                    keepAliveTask = new KeepAliveTask();
                    TaskEngine.getInstance().scheduleAtFixedRate(keepAliveTask, 15000, 30000);

                    timeoutTask = new TimeoutTask();
                    TaskEngine.getInstance().scheduleAtFixedRate(timeoutTask, 2000, 2000);

                } catch (DocumentException e) {
                    try {
                        socket.close();
                    }
                    catch (IOException ioe) {
                        // Do nothing
                    }
                    throw new ComponentException(e);
                } catch (XmlPullParserException e) {
                    try {
                        socket.close();
                    }
                    catch (IOException ioe) {
                        // Do nothing
                    }
                    throw new ComponentException(e);
                }
            } catch (XmlPullParserException e) {
                try {
                    socket.close();
                }
                catch (IOException ioe) {
                    // Do nothing
                }
                throw new ComponentException(e);
            }
        }
        catch (UnknownHostException uhe) {
            try {
                if (socket != null) socket.close();
            }
            catch (IOException e) {
                // Do nothing
            }
            throw new ComponentException(uhe);
        }
        catch (IOException ioe) {
            try {
                if (socket != null) socket.close();
            }
            catch (IOException e) {
                // Do nothing
            }
            throw new ComponentException(ioe);
        }
    }
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.