Package org.apache.avalon.framework.service

Examples of org.apache.avalon.framework.service.ServiceException


            (ComponentHandler) m_container.get( m_key, hint );
        if ( null == handler )
        {
            final String message =
                "The hint does not exist in the ComponentSelector";
            throw new ServiceException( m_key + "/" + String.valueOf(hint),
                message );
        }
        return handler;
    }
View Full Code Here


        if ( null == hintMap )
        {
            final String key = getRoleKey( role, hint );
            final String message = "Component does not exist";
            throw new ServiceException( key, message );
        }

        if ( null == hint )
        {
            // no hint -> try selector
            value = hintMap.get( SELECTOR_ENTRY );

            if ( null == value )
            {
                // no selector -> use default
                value = hintMap.get( DEFAULT_ENTRY );
            }

            return value;
        }

        // got a hint -> use it
        value = hintMap.get( hint );

        if ( null == value )
        {
            final String key = getRoleKey( role, hint );
            final String message = "Component does not exist";
            throw new ServiceException( key, message );
        }

        return value;
    }
View Full Code Here

        }
        catch( Throwable t )
        {
            String msg = "Failed to lookup a service " + name;
            this.getLogger().error( msg, t );
            throw new ServiceException( name, msg, t );
        }
    finally
    {
        this.releaseLock(lock);
    }

        // if we haven't found anything ask the parent ServiceManager

        if( result == null )
        {
            if( this.hasParentServiceManager() )
          {
              result = this.getParentServiceManager().lookup(name);
          }
        }

        // if we still haven't found anything then complain

        if( result == null )
        {
            String msg = "The following component does not exist : " + name;
            this.getLogger().error(msg);
            throw new ServiceException( AvalonYaafiConstants.AVALON_CONTAINER_YAAFI, name );
        }

        return result;
    }
View Full Code Here

        if( result == null )
        {
            String msg = "The following component does not exist : " + name;
            this.getLogger().error(msg);
            throw new ServiceException( AvalonYaafiConstants.AVALON_CONTAINER_YAAFI, name );
        }

        return result;
    }
View Full Code Here

            }
            catch (Throwable t)
            {
                String msg = "Servicing the following service failed : " + this.getShorthand();
                this.getParentLogger().error(msg,t);
                throw new ServiceException(this.getShorthand(),msg,t);
            }
        }
    }
View Full Code Here

                result[i] = (AvalonInterceptorService) currService;
            }
            else
            {
                String msg = "The following service is not an AvalonInterceptorService : " + interceptorServiceName;
                throw new ServiceException(AvalonYaafiConstants.AVALON_CONTAINER_YAAFI,msg);
            }
        }

        return result;
    }
View Full Code Here

                    Web3DataSourceSelectorImpl.pools.put(obj, pool);
                }
            }
        } catch (Exception ex) {
            getLogger().error(ex.getMessage(), ex);
            throw new ServiceException(null, ex.getMessage());
        } finally {
            Web3DataSourceSelectorImpl.lock.release();
        }
        getLogger().debug("Returning Web3DataSource[" + pool + "]");
        return pool;
View Full Code Here

            return this.components.get(selectionKey);
        }

        /* Fail miserably */
        String message = "No component associated with " + selectionKey;
        throw new ServiceException((String) selectionKey, message);
    }
View Full Code Here

        }
    }

    public Object select(Object hint) throws ServiceException {
        if (!isSelectable(hint))
            throw new ServiceException((String)hint, "Non-existing component for this hint");
        String stringHint = (String)hint;
        return components.get(stringHint);
    }
View Full Code Here

                if ( o instanceof ComponentSelector ) {
                    o = new ComponentSelectorWrapper((ComponentSelector)o);
                }
                return o;
            } catch (ComponentException ce) {
                throw new ServiceException("ComponentManagerWrapper", "Unable to lookup component: " + role, ce);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.service.ServiceException

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.