001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999-2005 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: EJBService.java 8409 2006-05-30 16:27:37Z sauthieg $
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas.container;
025:
026: import java.net.URL;
027:
028: import javax.naming.Context;
029:
030: import org.objectweb.jonas_ejb.container.Container;
031: import org.objectweb.jonas_lib.JWorkManager;
032:
033: import org.objectweb.jonas.service.Service;
034: import org.objectweb.jonas.service.ServiceException;
035:
036: /**
037: * EJB Service interface.
038: */
039: public interface EJBService extends Service {
040:
041: /**
042: * Create a JOnAS Container for all the beans that are described in a .xml file,
043: * or belong to .jar file.
044: * @param ctx JNDI context in which is found the container configuration.
045: * @return The ObjectName of the MBean associated to the container (i.e. to the deployed module)
046: */
047: String createContainer(Context ctx) throws Exception;
048:
049: String createContainer(String fileName) throws Exception;
050:
051: /**
052: * Test if the specified file is already deployed (if a container
053: * is created for this jar).
054: * @param fileName the name of the jar file
055: * @return true if the jar was deployed, false otherwise
056: */
057: Boolean isJarDeployed(String fileName);
058:
059: /**
060: * Test if the specified jar identified with its work name is already deployed
061: * (if a container is created for this jar).
062: * @param workFileName the internal name of the jar file (working copy)
063: * @return true if the jar was deployed, false otherwise
064: */
065: boolean isJarDeployedByWorkName(String workFileName);
066:
067: /**
068: * @return the Container by its file name (.xml or .jar)
069: */
070: Container getContainer(String fileName);
071:
072: /**
073: * Remove a JOnAS Container.
074: * @param cont JOnAS container to remove.
075: */
076: void removeContainer(Container cont);
077:
078: void removeContainer(String fileName) throws Exception;
079:
080: /**
081: * List of all JOnAS Containers
082: * @return an array of Container objects
083: */
084: Container[] listContainers();
085:
086: /**
087: * Synchronized all entity bean containers
088: * @param passivate passivate instances after synchronization.
089: */
090: void syncAllEntities(boolean passivate);
091:
092: /**
093: * Deploy the given ejb-jars of an ear file with the specified parent
094: * classloader (ear classloader). (This method is only used for
095: * the ear applications, not for the ejb-jar applications).
096: * @param ctx the context containing the configuration
097: * to deploy the ejbjars.<BR>
098: * This context contains the following parameters :<BR>
099: * - earRootUrl the root of the ear application.<BR>
100: * - earClassLoader the ear classLoader of the ear application.<BR>
101: * - ejbClassLoader the ejb classLoader for the ejbjars.<BR>
102: * - jarURLs the list of the urls of the ejb-jars to deploy.<BR>
103: * - roleNames the role names of the security-role.<BR>
104: * @return ClassLoader the ejbClassLoader created.
105: * @throws ServiceException if an error occurs during the deployment.
106: */
107: void deployJars(Context ctx) throws ServiceException;
108:
109: /**
110: * Undeploy the given ejb-jars of an ear file with the specified parent
111: * classloader (ear classloader). (This method is only used for
112: * the ear applications, not for the ejb-jar applications).
113: * @param urls the list of the urls of the ejb-jars to deploy.
114: */
115: void unDeployJars(URL[] urls);
116:
117: /**
118: * Make a cleanup of the cache of deployment descriptor. This method must
119: * be invoked after the ear deployment by the EAR service.
120: * the deployment of an ear by .
121: * @param earClassLoader the ClassLoader of the ear application to
122: * remove from the cache.
123: */
124: void removeCache(ClassLoader earClassLoader);
125:
126: /**
127: * Return the Ejbjars directory.
128: * @return The Ejbjars directory
129: */
130: String getEjbjarsDirectory();
131:
132: /**
133: * Check that GenIC have been applied on the given ejb-jar file
134: * If it was not done, it run GenIC against the file.
135: * @param fileName given EJB-JAR file.
136: * @param urls Array of URLs used as CLASSPATH during EJB compilation
137: */
138: void checkGenIC(String fileName, URL[] urls);
139:
140: /**
141: * Get the workManager
142: */
143: JWorkManager getWorkManager();
144: }
|