Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
OW2 Util Copyright (C) 2008 Contact: easybeans@objectweb.org This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------- $Id: DefaultFileDeployableFactoryManager.java --------------------------------------------------------------------------
package org.ow2.util.plan.deploy.deployable.impl.factory;
A IFileDeployableFactoryManager that owns a collection of managed factories and tries to build a deployable with them one by one.

Author(s):
mleduque
Logger.
    private static Log logger = LogFactory.getLog(DefaultFileDeployableFactoryManager.class);

    
FileDeployableFactory objects managed by the manager.
    public FileDeployable<?, ?> getFileDeployable(final IFileArchive fileArchivethrows FileDeployableException {
        FileDeployable<?, ?> fileDeployable = null;
        for (IFileDeployableFactory factory : ) {
            try {
                fileDeployable = factory.getFileDeployable(fileArchive);
                return fileDeployable;
            } catch (FileDeployableException e) {
                .warn("factory {0} doesn''t support archive {1}"factoryfileArchivee);
            }
        }
        /* No factory in the manager supports the archive type */
        throw new FileDeployableException();
    }

    
Adds a factory to the list of managed factories.

Parameters:
factory the added factory
    public void addFileDeployableFactory(final IFileDeployableFactory factory) {
        .add(factory);
    }

    
Removes a factory from the list of managed factories.

Parameters:
factory the removed factory.
    public void removeFileDeployableFactory(final IFileDeployableFactory factory) {
        .remove(factory);
    }
New to GrepCode? Check out our FAQ X