Package org.apache.fulcrum.yaafi.framework.component

Examples of org.apache.fulcrum.yaafi.framework.component.ServiceComponent


     * @see org.apache.fulcrum.yaafi.framework.container.ServiceLifecycleManager#getRoleEntries()
     */
    public synchronized RoleEntry[] getRoleEntries()
    {
        List serviceList = this.getServiceList();
        ServiceComponent serviceComponent = null;
        RoleEntry[] result = new RoleEntry[serviceList.size()];

        for( int i=0; i<result.length; i++ )
        {
            serviceComponent = (ServiceComponent) serviceList.get(i);
            result[i] = serviceComponent.getRoleEntry();
        }

        return result;
    }
View Full Code Here


    public Object lookup(String name) throws ServiceException
    {
        Validate.notEmpty( name, "name" );

        Object result = null;
        ServiceComponent serviceManagerComponent = null;

        try
        {
            synchronized (this)
            {
                // 1) check our local services

                serviceManagerComponent = this.getLocalServiceComponent(name);

                if( serviceManagerComponent != null )
                {
                    result = serviceManagerComponent.getInstance();

                    if((result != null) && this.getLogger().isDebugEnabled())
                    {
                        String msg = "Located the service '" + name + "' in the local container";
                        this.getLogger().debug(msg);
View Full Code Here

     * @see org.apache.fulcrum.yaafi.framework.container.ServiceContainer#decommision(java.lang.String)
     */
    public synchronized void decommision(String name) throws ServiceException
    {
        this.waitForReconfiguration();      
        ServiceComponent serviceComponent = this.getServiceComponentEx(name);
        this.decommision(serviceComponent);
    }
View Full Code Here

     */
    private void reconfigure(String name)
        throws ServiceException, ConfigurationException
    {
        Validate.notEmpty( name, "name" );
        ServiceComponent serviceComponent = this.getServiceComponentEx(name);

        // reconfigure the component

        try
        {
            serviceComponent.reconfigure();
        }
        catch(ConfigurationException e)
        {
            String msg = "Reconfiguring failed : " + serviceComponent.getShorthand();
            this.getLogger().error(msg,e);
            throw new ConfigurationException(msg,e);
        }
        catch(Throwable t)
        {
            String msg = "Reconfiguring failed : " + serviceComponent.getShorthand();
            this.getLogger().error(msg,t);
            throw new ConfigurationException(msg,t);
        }
    }
View Full Code Here

     */
    private ServiceComponent getServiceComponentEx(String name)
        throws ServiceException
    {
        Validate.notEmpty( name, "name" );
        ServiceComponent result = (ServiceComponent) this. getServiceMap().get(name);

        if( result == null )
        {
            String msg = "The following component does not exist : " + name;
            this.getLogger().error(msg);
View Full Code Here

     * @return the service component if any
     */
    private ServiceComponent getLocalServiceComponent(String name)
    {
        Validate.notEmpty( name, "name" );
        ServiceComponent result = (ServiceComponent) this. getServiceMap().get(name);
        return result;
    }
View Full Code Here

    {

        Validate.notEmpty( name, "name" );

        Object result = null;
        ServiceComponent serviceManagerComponent = null;

        for(int i=0; i<this.fallbackServiceManagerList.size(); i++)
        {
            String serviceManagerComponentName = (String) fallbackServiceManagerList.get(i);
            serviceManagerComponent = this.getLocalServiceComponent(serviceManagerComponentName);

            if(serviceManagerComponent != null)
            {
                ServiceManager currServiceManager = (ServiceManager) serviceManagerComponent.getInstance();

                if (currServiceManager.hasService(name))
                {
                    result = currServiceManager.lookup(name);
View Full Code Here

     */
    private boolean hasFallbackService(String name)
    {
        Validate.notEmpty( name, "name" );

        ServiceComponent serviceManagerComponent = null;

        for(int i=0; i<this.fallbackServiceManagerList.size(); i++)
        {
            String serviceManagerComponentName = (String) fallbackServiceManagerList.get(i);
            serviceManagerComponent = this.getLocalServiceComponent(serviceManagerComponentName);

            if(serviceManagerComponent != null)
            {
                ServiceManager currServiceManager;

                try
                {
                    currServiceManager = (ServiceManager) serviceManagerComponent.getInstance();
                    if (currServiceManager.hasService(name))
                    {
                        return true;
                    }
                }
View Full Code Here

     * @throws Exception the incarnation of a service failed
     */
    private void incarnateAll(List serviceList)
        throws Exception
    {
        ServiceComponent serviceComponent = null;

        // configure all services

        for( int i=0; i<serviceList.size(); i++ )
        {
View Full Code Here

     *
     * @param serviceList the list of services to decommision
     */
    private void decommisionAll(List serviceList)
    {
        ServiceComponent serviceComponent = null;

        for( int i=serviceList.size()-1; i>=0; i-- )
        {
            serviceComponent = (ServiceComponent) serviceList.get(i);
            this.decommision( serviceComponent );
View Full Code Here

TOP

Related Classes of org.apache.fulcrum.yaafi.framework.component.ServiceComponent

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.