|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.management.NotificationBroadcasterSupport
org.cafesip.jiplet.JipletContainer
public class JipletContainer
This class represents the Jiplet Container. The jiplet container hosts multiple contexts. Each context is a separate application that has its own class loader and therefore completely isolated from each other. Each context may contain one or more jiplets. The container exposes a JMX management interface for managing the contexts. Using this interface, a context may be added or removed from the container. Alternatively, a container may be deployed by simply adding the content of the context to the deploy directory of the container and re-starting the jilet container application. Unlike most servlet container and J2EE server applications, the container does not periodically check its deploy directory to determine if a new context has been added.
The contexts may be deployed either in the "spr" format or in "exploded" format. The spr format consist of a single file that packs all the classes, data files and descriptors beloging to a context. The files are packed using the jar/zip utility. A custom ant task has been provided to zip the content of a context directory. A spr is equivalent to a "war" file in the servlet/JSP world. The jiplet container server application can either run as a Java standalone application similar to Apache Tomcat. But it can also be deployed as a JBOSS service (incidentally Tomcat can also be run as a JBOSS service). When running as a JBOSS service, it can be managed from the JBOSS management console and it also supports deployment of spr files using the JBOSS deployment infrastructure.
| Field Summary | |
|---|---|
static javax.management.ObjectName |
MBEAN_NAME
|
| Constructor Summary | |
|---|---|
JipletContainer()
Constructor for the class. |
|
| Method Summary | |
|---|---|
java.lang.String |
addContextMapping(java.lang.String context,
java.lang.String mapping)
This method adds a context mapping to the list of context mappings. |
java.lang.String |
createContext(java.lang.String path,
java.lang.String overriddenName)
Create a jiplet context. |
java.lang.String |
createJ2eeContext(java.lang.String path,
java.lang.ClassLoader loader)
Create a J2EE context. |
java.lang.String |
createJ2eeRealm(java.lang.String path,
java.lang.ClassLoader loader)
Create a J2EE realm. |
java.lang.String |
createRealm(java.lang.String path)
Create a new realm. |
java.lang.String |
createRealmUser(java.lang.String name,
java.lang.String user,
java.lang.String password,
java.lang.String[] roles)
Create an user account for a given realm. |
java.lang.String |
deleteContext(java.lang.String name)
Delete a context with a given name. |
java.lang.String |
deleteJ2eeContext(java.lang.String path)
The JBOSS wrapper application uses this method to delete a context when it has been removed from the JBOSS deploy directory. |
java.lang.String |
deleteJ2eeRealm(java.lang.String path)
The JBOSS wrapper application uses this method to delete a realm when it has been removed from the JBOSS deploy directory. |
java.lang.String |
deleteRealm(java.lang.String realmName)
Delete an existing realm. |
java.lang.String |
deleteRealmUser(java.lang.String name,
java.lang.String user)
Delete an user account for a given realm |
void |
destroy()
This method is called when the application disposes off the container. |
SipConnector |
findConnector(java.lang.String name)
Returns a SipConnector object of a given connector name. |
Realm |
findRealm(java.lang.String name)
|
protected long |
getAuthCachePeriod()
|
static java.io.File |
getConfDir()
|
org.cafesip.jiplet.jmxbeans.ConnectorElement |
getConnectorProperty(java.lang.String connectorName)
Returns the property of a connector. |
java.util.HashMap |
getConnectors()
Returns a list of the connectors. |
protected java.util.ArrayList |
getContextMapping(java.lang.String context)
|
org.cafesip.jiplet.jmxbeans.ContextElement |
getContextProperty(java.lang.String name)
Return the property of a context specified by the name parameter. |
java.lang.String |
getDefaultConnectorName()
|
java.lang.String |
getDefaultRealm()
|
java.lang.String |
getDeployDir()
return the deploy directory |
static JipletContainer |
getInstance()
The JipletContainer is a singleton class. |
protected static javax.management.MBeanServer |
getJmxAgent()
Returns the JMX MBeanServer object. |
java.lang.String |
getRealmDirName(java.lang.String realmName)
Returns the realm deployment directory name. |
org.cafesip.jiplet.jmxbeans.RealmElement |
getRealmProperty(java.lang.String realmName)
Returns the property of a realm. |
protected java.util.ArrayList |
getRealms()
|
java.lang.String[] |
getRealmUser(java.lang.String name,
java.lang.String user)
Returns the user account information for a given realm. |
static VendorDescriptorFactory |
getVendorDeploymentFactory()
|
void |
init()
|
protected boolean |
isAuthOnLogout()
|
java.lang.String[] |
listConnectors()
Return a list of deployed connectors. |
java.lang.String[] |
listContexts()
Return a list of deployed contexts. |
java.lang.String[] |
listRealms()
Returns a list of realms configured for the system. |
java.lang.String |
modifyRealmUser(java.lang.String name,
java.lang.String user,
java.lang.String password,
java.lang.String[] roles)
Modify an user account for a given realm. |
java.lang.String |
removeContextMapping(java.lang.String context)
Removes the entry for the context from the context mapping. |
static void |
setConfDir(java.io.File confDir)
|
static void |
setDeployDir(java.io.File dir)
Sets the deploy directory. |
static void |
setJmxAgent(javax.management.MBeanServer jmxAgent)
|
static void |
setVendorDeploymentFactory(VendorDescriptorFactory vendorDeploymentFactory)
|
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
|---|
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static javax.management.ObjectName MBEAN_NAME
| Constructor Detail |
|---|
public JipletContainer()
throws JipletException
JipletException| Method Detail |
|---|
public void init()
throws java.lang.Exception
java.lang.Exception
public static JipletContainer getInstance()
throws java.lang.Exception
java.lang.Exceptionpublic static void setDeployDir(java.io.File dir)
dir - public java.util.HashMap getConnectors()
for more details.public java.lang.String getDefaultConnectorName()
getDefaultConnectorName in interface JipletContainerMBeanpublic SipConnector findConnector(java.lang.String name)
name - name of the connector
public void destroy()
public java.lang.String createContext(java.lang.String path,
java.lang.String overriddenName)
JipletContainerMBean
createContext in interface JipletContainerMBeanpath - full path name of the directory where a spr file or an exploded directory resides.overriddenName - this is an optional parameter. If a non-null string is provided, the context name is set
to this parameter. If null value is specified, the context is named based on the exploded directory name or the
spr file name (the .spr extension is stripped).
public java.lang.String deleteContext(java.lang.String name)
JipletContainerMBean
deleteContext in interface JipletContainerMBeanname - name of the context.
public java.lang.String[] listContexts()
JipletContainerMBean
listContexts in interface JipletContainerMBeanprotected static javax.management.MBeanServer getJmxAgent()
public static void setJmxAgent(javax.management.MBeanServer jmxAgent)
jmxAgent - The jmxAgent to set.public org.cafesip.jiplet.jmxbeans.ContextElement getContextProperty(java.lang.String name)
JipletContainerMBean
getContextProperty in interface JipletContainerMBeanname - name of the context.
public java.lang.String getDeployDir()
JipletContainerMBean
getDeployDir in interface JipletContainerMBean
public java.lang.String createJ2eeContext(java.lang.String path,
java.lang.ClassLoader loader)
path - the path of the SPR fileloader - - the J2EE classloader
public java.lang.String deleteJ2eeContext(java.lang.String path)
path -
protected java.util.ArrayList getRealms()
public Realm findRealm(java.lang.String name)
public java.lang.String getDefaultRealm()
protected long getAuthCachePeriod()
public java.lang.String[] listRealms()
JipletContainerMBean
listRealms in interface JipletContainerMBean
public java.lang.String createRealmUser(java.lang.String name,
java.lang.String user,
java.lang.String password,
java.lang.String[] roles)
JipletContainerMBean
createRealmUser in interface JipletContainerMBeanname - realm nameuser - user namepassword - passwordroles - roles authorized for this user.
public java.lang.String modifyRealmUser(java.lang.String name,
java.lang.String user,
java.lang.String password,
java.lang.String[] roles)
JipletContainerMBean
modifyRealmUser in interface JipletContainerMBeanname - realm nameuser - user namepassword - password. If null, the password is not modifiedroles - roles authorized for this user. If null, the roles are not modified.
public java.lang.String deleteRealmUser(java.lang.String name,
java.lang.String user)
JipletContainerMBean
deleteRealmUser in interface JipletContainerMBeanname - realm nameuser - user name
public java.lang.String[] getRealmUser(java.lang.String name,
java.lang.String user)
JipletContainerMBean
getRealmUser in interface JipletContainerMBeanname - realm nameuser - user nameprotected boolean isAuthOnLogout()
public java.lang.String createJ2eeRealm(java.lang.String path,
java.lang.ClassLoader loader)
path - loader -
public java.lang.String deleteJ2eeRealm(java.lang.String path)
path -
public java.lang.String createRealm(java.lang.String path)
JipletContainerMBean
createRealm in interface JipletContainerMBeanpath - path containing the exploded SRR entry or a SRR file.
public java.lang.String deleteRealm(java.lang.String realmName)
JipletContainerMBean
deleteRealm in interface JipletContainerMBeanrealmName - name of the realm
public java.lang.String getRealmDirName(java.lang.String realmName)
JipletContainerMBean
getRealmDirName in interface JipletContainerMBeanpublic org.cafesip.jiplet.jmxbeans.RealmElement getRealmProperty(java.lang.String realmName)
JipletContainerMBean
getRealmProperty in interface JipletContainerMBeanprotected java.util.ArrayList getContextMapping(java.lang.String context)
public java.lang.String addContextMapping(java.lang.String context,
java.lang.String mapping)
JipletContainerMBean
addContextMapping in interface JipletContainerMBeancontext - name of the context.mapping - The mapping must be specified using the XML descriptor as described by
$JIPLET_HOME/conf/context-mappings_x.y.xsd, where x.y is the current version of the descriptor file.
For each context mapping, the context name and the connector name is mandatory.
public java.lang.String removeContextMapping(java.lang.String context)
JipletContainerMBean
removeContextMapping in interface JipletContainerMBeancontext - name of the context.
public java.lang.String[] listConnectors()
JipletContainerMBean
listConnectors in interface JipletContainerMBeanpublic org.cafesip.jiplet.jmxbeans.ConnectorElement getConnectorProperty(java.lang.String connectorName)
JipletContainerMBean
getConnectorProperty in interface JipletContainerMBeanpublic static java.io.File getConfDir()
public static void setConfDir(java.io.File confDir)
confDir - The confDir to set.public static VendorDescriptorFactory getVendorDeploymentFactory()
public static void setVendorDeploymentFactory(VendorDescriptorFactory vendorDeploymentFactory)
vendorDeploymentFactory - The vendorDeploymentFactory to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||