001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package javax.enterprise.deploy.spi;
023:
024: import java.io.InputStream;
025: import java.io.OutputStream;
026:
027: import javax.enterprise.deploy.model.DDBeanRoot;
028: import javax.enterprise.deploy.model.DeployableObject;
029: import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException;
030: import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
031:
032: /**
033: * A container for server specific configuration for a top level deployment.
034: *
035: * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
036: * @version $Revision: 57196 $
037: */
038: public interface DeploymentConfiguration {
039: // Constants -----------------------------------------------------
040:
041: // Public --------------------------------------------------------
042:
043: /**
044: * Return an object that provides access to the deployment descriptor
045: *
046: * @return the deployable object
047: */
048: DeployableObject getDeployableObject();
049:
050: /**
051: * Return the top level configuration for a deployment descriptor
052: *
053: * @param bean the root of the deployment descriptor
054: * @return the configuration
055: * @throws ConfigurationException for an error in the deployment descriptor
056: */
057: DConfigBeanRoot getDConfigBeanRoot(DDBeanRoot bean)
058: throws ConfigurationException;
059:
060: /**
061: * Remove a root configuration and all its children
062: *
063: * @param bean the configuration
064: * @throws BeanNotFoundException when the bean is not found
065: */
066: void removeDConfigBean(DConfigBeanRoot bean)
067: throws BeanNotFoundException;
068:
069: /**
070: * Restore a configuration from an input stream
071: *
072: * @param input the input stream
073: * @param bean the deployment descriptor
074: * @return the configuration
075: * @throws ConfigurationException when there is an error in the configuration
076: */
077: DConfigBeanRoot restoreDConfigBean(InputStream input,
078: DDBeanRoot bean) throws ConfigurationException;
079:
080: /**
081: * Save a configuration to an output stream
082: *
083: * @param output the output stream
084: * @param bean the configuration
085: * @throws ConfigurationException when there is an error in the configuration
086: */
087: void saveDConfigBean(OutputStream output, DConfigBeanRoot bean)
088: throws ConfigurationException;
089:
090: /**
091: * Restores a full set of configuration beans
092: *
093: * @param input the input stream
094: * @throws ConfigurationException for an error in the configuration
095: */
096: void restore(InputStream input) throws ConfigurationException;
097:
098: /**
099: * Saves the fulls set of configuration beans
100: *
101: * @param output the output stream
102: * @throws ConfigurationException for an error in the configuration
103: */
104: void save(OutputStream output) throws ConfigurationException;
105: }
|