Package org.apache.avalon.framework.service

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


        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


            fileUpload.setHeaderEncoding(headerEncoding);
            return fileUpload.parseRequest(req);
        }
        catch (FileUploadException e)
        {
            throw new ServiceException(UploadService.ROLE, e.getMessage(), e);
        }
    }
View Full Code Here

        {
            return upload.getItemIterator(req);
        }
        catch (FileUploadException e)
        {
            throw new ServiceException(UploadService.ROLE, e.getMessage(), e);
        }
        catch (IOException e)
        {
            throw new ServiceException(UploadService.ROLE, e.getMessage(), e);
        }
    }
View Full Code Here

        {
            return manager.lookup(roleName);
        }
        catch (ComponentException e)
        {
            throw new ServiceException(name, e.getMessage());
        }
    }
View Full Code Here

            fileUpload.setHeaderEncoding(headerEncoding);
            return fileUpload.parseRequest(req);
        }
        catch (FileUploadException e)
        {
            throw new ServiceException(UploadService.ROLE, e.getMessage(), e);
        }
    }
View Full Code Here

    // ServiceSelector
    //

    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

                    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

        {
            StringBuffer errorBuffer =
                new StringBuffer(128).append("Component ").append(
                    MailServer.ROLE).append(
                    "does not implement the required interface.");
            throw new ServiceException("", errorBuffer.toString());
        }

        UsersStore usersStore =
            (UsersStore) manager.lookup("org.apache.james.services.UsersStore");
        setLocalUsers(usersStore.getRepository("LocalUsers"));
        if (getLocalUsers() == null)
            throw new ServiceException(
                "",
                "The user repository could not be found.");
    }
View Full Code Here

            ContainerUtil.enableLogging( this.authenticator, this.getLogger() );
            ContainerUtil.contextualize( this.authenticator, this.context);
            ContainerUtil.service( this.authenticator, this.manager );
            ContainerUtil.initialize( this.authenticator );
        } catch (Exception e ) {
            throw new ServiceException("Unable to initialize authenticator.", e);
        }
        this.resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
  }
View Full Code Here

    /**
     * @see org.apache.avalon.framework.service.ServiceManager#lookup(java.lang.String)
     */
    public Object lookup(String role) throws ServiceException {
        if ( !this.hasService(role) ) {
            throw new ServiceException("AvalonServiceManager",
                                       "Component with '" + role + "' is not defined in this service manager.");
        }
        try {
            return this.beanFactory.getBean(role);
        } catch (BeansException be) {
            throw new ServiceException("AvalonServiceManager",
                                       "Exception during lookup of component with '" + role + "'.", be);
        }
    }
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.