Revision: b100126cff44
Author:   josemrecio <[email protected]>
Date:     Tue Jul 24 13:43:32 2012
Log:      Support for AS7 cli console

Example command:
[standalone@localhost:9999 deployment=test2-as7-sip-war.war] ls subsystem=sip
servlet                                    active-sip-application-sessions=1
active-sip-sessions=0 expired-sip-application-sessions=1
expired-sip-sessions=1                     max-active-sip-sessions=-1
rejected-sip-application-sessions=0        rejected-sip-sessions=0
sip-application-session-avg-alive-time=0 sip-application-session-max-alive-time=0 sip-application-sessions-created=2 sip-application-sessions-per-sec=0.0
sip-session-avg-alive-time=0               sip-session-max-alive-time=0
sip-sessions-created=1                     sip-sessions-per-sec=0.0
[standalone@localhost:9999 deployment=test2-as7-sip-war.war]

Still missed: support for servlet statistics (StandardWrapperValve methods are not being invoked) and connector stats.

http://code.google.com/p/sipservlets/source/detail?r=b100126cff44

Added:
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/deployment/SipDeploymentService.java /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/deployment/SipWarDeploymentProcessor.java
Modified:
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDeploymentDefinition.java /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDeploymentServletDefinition.java /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipMessages.java /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemAdd.java /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemServices.java /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/resources/org/mobicents/as7/LocalDescriptions.properties

=======================================
--- /dev/null
+++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/deployment/SipDeploymentService.java Tue Jul 24 13:43:32 2012
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.mobicents.as7.deployment;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.core.StandardContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.msc.service.Service;
+import org.jboss.msc.service.StartContext;
+import org.jboss.msc.service.StartException;
+import org.jboss.msc.service.StopContext;
+
+/**
+ * A service starting a sip deployment.
+ * For sip, this is required so far only as a way to provide the context to management methods
+ *
+ * @author Emanuel Muckenhuber
+ * @author [email protected]
+ */
+class SipDeploymentService implements Service<Context> {
+
+    private StandardContext sipContext;
+    private final DeploymentUnit du;
+
+    public SipDeploymentService(final DeploymentUnit du) {
+        this.du = du;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+ public synchronized void start(StartContext startContext) throws StartException {
+        if (sipContext == null) {
+               this.sipContext = du.getAttachment(SIPWebContext.ATTACHMENT);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public synchronized void stop(StopContext stopContext) {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public synchronized Context getValue() throws IllegalStateException {
+        final Context sipContext = this.sipContext;
+        if (sipContext == null) {
+            throw new IllegalStateException();
+        }
+        return sipContext;
+    }
+
+}
=======================================
--- /dev/null
+++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/deployment/SipWarDeploymentProcessor.java Tue Jul 24 13:43:32 2012
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.as7.deployment;
+
+import static org.mobicents.as7.SipMessages.MESSAGES;
+
+import org.jboss.as.controller.PathElement;
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.web.deployment.WarMetaData;
+import org.jboss.dmr.ModelNode;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.modules.Module;
+import org.jboss.msc.service.ServiceBuilder;
+import org.jboss.msc.service.ServiceController.Mode;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.ServiceRegistryException;
+import org.jboss.msc.service.ServiceTarget;
+import org.jboss.vfs.VirtualFile;
+import org.mobicents.as7.SipSubsystemServices;
+import org.mobicents.metadata.sip.spec.SipMetaData;
+
+
+/**
+ * {@code DeploymentUnitProcessor} creating the actual deployment services.
+ * For SIP this is only required to setup management points
+ *
+ * @author Emanuel Muckenhuber
+ * @author [email protected]
+ * @author [email protected]
+ */
+public class SipWarDeploymentProcessor implements DeploymentUnitProcessor {
+
+    public SipWarDeploymentProcessor() {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { + final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); + final WarMetaData metaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
+        if (metaData == null) {
+            return;
+        }
+        processDeployment(deploymentUnit, phaseContext.getServiceTarget());
+    }
+
+    @Override
+    public void undeploy(final DeploymentUnit context) {
+       // TODO
+    }
+
+    protected void processDeployment(final DeploymentUnit deploymentUnit,
+ final ServiceTarget serviceTarget) throws DeploymentUnitProcessingException { + final VirtualFile deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); + final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
+        if (module == null) {
+ throw new DeploymentUnitProcessingException(MESSAGES.failedToResolveModule(deploymentRoot));
+        }
+ final SipMetaData sipMetaData = deploymentUnit.getAttachment(SipMetaData.ATTACHMENT_KEY); + final ServiceName deploymentServiceName = SipSubsystemServices.deploymentServiceName();
+        try {
+ final SipDeploymentService sipDeploymentService = new SipDeploymentService(deploymentUnit);
+               ServiceBuilder<?> builder = serviceTarget
+                               .addService(deploymentServiceName, 
sipDeploymentService);
+
+//             TODO: when distributable is implemented
+//             if (sipMetaData.getDistributable() != null) {
+// DistributedCacheManagerFactoryService factoryService = new DistributedCacheManagerFactoryService(); +// DistributedCacheManagerFactory factory = factoryService.getValue();
+//                     if (factory != null) {
+// ServiceName factoryServiceName = deploymentServiceName.append("session"); +// builder.addDependency(DependencyType.OPTIONAL, factoryServiceName, DistributedCacheManagerFactory.class, config.getDistributedCacheManagerFactoryInjector());
+//
+// ServiceBuilder<DistributedCacheManagerFactory> factoryBuilder = serviceTarget.addService(factoryServiceName, factoryService); +// boolean enabled = factory.addDeploymentDependencies(deploymentServiceName, deploymentUnit.getServiceRegistry(), serviceTarget, factoryBuilder, metaData); +// factoryBuilder.setInitialMode(enabled ? ServiceController.Mode.ON_DEMAND : ServiceController.Mode.NEVER).install();
+//                     }
+//             }
+            // add dependency to sip deployment service
+            builder.addDependency(deploymentServiceName);
+            builder.setInitialMode(Mode.ACTIVE).install();
+        } catch (ServiceRegistryException e) {
+ throw new DeploymentUnitProcessingException(MESSAGES.failedToAddSipDeployment(), e);
+        }
+
+        processManagement(deploymentUnit, sipMetaData);
+    }
+
+ void processManagement(final DeploymentUnit unit, final SipMetaData sipMetaData) { + for (final ServletMetaData servlet : sipMetaData.getSipServlets()) {
+            try {
+                final String name = servlet.getName().replace(' ', '_');
+ final ModelNode node = unit.createDeploymentSubModel("sip", PathElement.pathElement("servlet", name));
+                node.get("servlet-class").set(servlet.getServletClass());
+                node.get("servlet-name").set(servlet.getServletName());
+            } catch (Exception e) {
+ // Should a failure in creating the mgmt view also make to the deployment to fail?
+                continue;
+            }
+        }
+
+    }
+}
+
=======================================
--- /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDeploymentDefinition.java Sun Jul 8 12:14:07 2012 +++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDeploymentDefinition.java Tue Jul 24 13:43:32 2012
@@ -1,41 +1,35 @@
 package org.mobicents.as7;

-import org.apache.catalina.Context;
-import org.apache.catalina.session.ManagerBase;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
+
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.jboss.as.controller.AbstractRuntimeOnlyHandler;
 import org.jboss.as.controller.AttributeDefinition;
 import org.jboss.as.controller.OperationContext;
 import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.controller.PathAddress;
 import org.jboss.as.controller.PathElement;
 import org.jboss.as.controller.SimpleAttributeDefinition;
-import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
 import org.jboss.as.controller.SimpleResourceDefinition;
 import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
 import org.jboss.as.controller.registry.ManagementResourceRegistration;
-import org.jboss.as.controller.registry.Resource;
 import org.jboss.dmr.ModelNode;
 import org.jboss.dmr.ModelType;
 import org.jboss.msc.service.ServiceController;
-
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
+import org.mobicents.as7.deployment.SIPWebContext;
+import org.mobicents.servlet.sip.core.SipManager;

 /**
  * @author Tomaz Cerar
  * @author <a href="mailto:[email protected]";>Torben Jaeger</a>
  * @created 23.2.12 18:32
+ * @author [email protected]
  */
-//TODO: josemrecio - check if using virtual-host and context-root make sense
 public class SipDeploymentDefinition extends SimpleResourceDefinition {
public static final SipDeploymentDefinition INSTANCE = new SipDeploymentDefinition();

- public static final AttributeDefinition CONTEXT_ROOT = new SimpleAttributeDefinitionBuilder("context-root", ModelType.STRING).setStorageRuntime().build(); - public static final AttributeDefinition VIRTUAL_HOST = new SimpleAttributeDefinitionBuilder("virtual-host", ModelType.STRING).setStorageRuntime().build();
-
     private SipDeploymentDefinition() {
super(PathElement.pathElement(SUBSYSTEM, SipExtension.SUBSYSTEM_NAME),
               SipExtension.getResourceDescriptionResolver("deployment"));
@@ -44,8 +38,6 @@

     @Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
-        resourceRegistration.registerReadOnlyAttribute(CONTEXT_ROOT, null);
-        resourceRegistration.registerReadOnlyAttribute(VIRTUAL_HOST, null);
         for (SessionStat stat : SessionStat.values()) {
resourceRegistration.registerMetric(stat.definition, SessionManagerStatsHandler.getInstance());
         }
@@ -65,52 +57,68 @@
         @Override
protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException {

- final PathAddress address = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR));
-
- final Resource web = context.readResourceFromRoot(address.subAddress(0, address.size()), false);
-            final ModelNode subModel = web.getModel();
-
- final String host = VIRTUAL_HOST.resolveModelAttribute(context, subModel).asString(); - final String path = CONTEXT_ROOT.resolveModelAttribute(context, subModel).asString();
-
- final ServiceController<?> controller = context.getServiceRegistry(false).getService(SipSubsystemServices.deploymentServiceName(host, path));
-
- SessionStat stat = SessionStat.getStat(operation.require(ModelDescriptionConstants.NAME).asString());
-
-            if (stat == null) {
- context.getFailureDescription().set(SipMessages.MESSAGES.unknownMetric(operation.require(ModelDescriptionConstants.NAME).asString())); + final ServiceController<?> controller = context.getServiceRegistry(false).getService(SipSubsystemServices.deploymentServiceName()); + SessionStat stat = SessionStat.getStat(operation.require(ModelDescriptionConstants.NAME).asString());
+
+               if (stat == null) {
+ context.getFailureDescription().set(SipMessages.MESSAGES.unknownMetric(operation.require(ModelDescriptionConstants.NAME).asString()));
             } else {
- final Context webContext = Context.class.cast(controller.getValue());
-                ManagerBase sm = (ManagerBase) webContext.getManager();
+ final SIPWebContext sipContext = SIPWebContext.class.cast(controller.getValue());
+                SipManager sm = (SipManager) sipContext.getManager();
                 ModelNode result = new ModelNode();
                 switch (stat) {
-                    case ACTIVE_SESSIONS:
-                        // todo: what about other manager implementations?
-// if (sm.getDistributable() && (sm instanceof DistributableSessionManager)) { -// result.set(((DistributableSessionManager)sm).getActiveSessionCount());
-//                  }
-                        result.set(sm.getActiveSessions());
+                    case ACTIVE_SIP_SESSIONS:
+//                     // TODO: what about other manager implementations?
+// if (sm.getDistributable() && (sm instanceof DistributableSessionManager)) { +// result.set(((DistributableSessionManager)sm).getActiveSessionCount());
+//                     }
+                       result.set(sm.getActiveSipSessions());
                         break;
-                    case EXPIRED_SESSIONS:
-                        result.set(sm.getExpiredSessions());
+                    case ACTIVE_SIP_APP_SESSIONS:
+//                     // TODO: what about other manager implementations?
+// if (sm.getDistributable() && (sm instanceof DistributableSessionManager)) { +// result.set(((DistributableSessionManager)sm).getActiveSessionCount());
+//                     }
+                       result.set(sm.getActiveSipApplicationSessions());
                         break;
-                    case MAX_ACTIVE_SESSIONS:
-                        result.set(sm.getMaxActive());
+                    case EXPIRED_SIP_SESSIONS:
+                        result.set(sm.getExpiredSipSessions());
                         break;
-                    case SESSIONS_CREATED:
-                        result.set(sm.getSessionCounter());
+                    case EXPIRED_SIP_APP_SESSIONS:
+                        result.set(sm.getExpiredSipApplicationSessions());
                         break;
-                    case DUPLICATED_SESSION_IDS:
-                        result.set(sm.getDuplicates());
+                    case MAX_ACTIVE_SIP_SESSIONS:
+                        result.set(sm.getMaxActiveSipSessions());
                         break;
-                    case SESSION_AVG_ALIVE_TIME:
-                        result.set(sm.getSessionAverageAliveTime());
+                    case SIP_SESSIONS_CREATED:
+                        result.set(sm.getSipSessionCounter());
                         break;
-                    case SESSION_MAX_ALIVE_TIME:
-                        result.set(sm.getSessionMaxAliveTime());
+                    case SIP_APP_SESSIONS_CREATED:
+                        result.set(sm.getSipApplicationSessionCounter());
                         break;
-                    case REJECTED_SESSIONS:
-                        result.set(sm.getRejectedSessions());
+                    case SIP_SESSIONS_CREATION_RATE:
+ result.set(sm.getNumberOfSipSessionCreationPerSecond());
+                        break;
+                    case SIP_APP_SESSIONS_CREATION_RATE:
+ result.set(sm.getNumberOfSipApplicationSessionCreationPerSecond());
+                        break;
+                    case SIP_SESSION_AVG_ALIVE_TIME:
+                        result.set(sm.getSipSessionAverageAliveTime());
+                        break;
+                    case SIP_APP_SESSION_AVG_ALIVE_TIME:
+ result.set(sm.getSipApplicationSessionAverageAliveTime());
+                        break;
+                    case SIP_SESSION_MAX_ALIVE_TIME:
+                        result.set(sm.getSipSessionMaxAliveTime());
+                        break;
+                    case SIP_APP_SESSION_MAX_ALIVE_TIME:
+ result.set(sm.getSipApplicationSessionMaxAliveTime());
+                        break;
+                    case REJECTED_SIP_SESSIONS:
+                        result.set(sm.getRejectedSipSessions());
+                        break;
+                    case REJECTED_SIP_APP_SESSIONS:
+                        result.set(sm.getRejectedSipSessions());
                         break;
                     default:
throw new IllegalStateException(SipMessages.MESSAGES.unknownMetric(stat));
@@ -124,14 +132,21 @@
     }

     public enum SessionStat {
- ACTIVE_SESSIONS(new SimpleAttributeDefinition("active-sessions", ModelType.INT, false)), - EXPIRED_SESSIONS(new SimpleAttributeDefinition("expired-sessions", ModelType.INT, false)), - SESSIONS_CREATED(new SimpleAttributeDefinition("sessions-created", ModelType.INT, false)), - DUPLICATED_SESSION_IDS(new SimpleAttributeDefinition("duplicated-session-ids", ModelType.INT, false)), - SESSION_AVG_ALIVE_TIME(new SimpleAttributeDefinition("session-avg-alive-time", ModelType.INT, false)), - SESSION_MAX_ALIVE_TIME(new SimpleAttributeDefinition("session-max-alive-time", ModelType.INT, false)), - REJECTED_SESSIONS(new SimpleAttributeDefinition("rejected-sessions", ModelType.INT, false)), - MAX_ACTIVE_SESSIONS(new SimpleAttributeDefinition("max-active-sessions", ModelType.INT, false)); + ACTIVE_SIP_SESSIONS(new SimpleAttributeDefinition("active-sip-sessions", ModelType.INT, false)), + ACTIVE_SIP_APP_SESSIONS(new SimpleAttributeDefinition("active-sip-application-sessions", ModelType.INT, false)), + EXPIRED_SIP_SESSIONS(new SimpleAttributeDefinition("expired-sip-sessions", ModelType.INT, false)), + EXPIRED_SIP_APP_SESSIONS(new SimpleAttributeDefinition("expired-sip-application-sessions", ModelType.INT, false)), + SIP_SESSIONS_CREATED(new SimpleAttributeDefinition("sip-sessions-created", ModelType.INT, false)), + SIP_APP_SESSIONS_CREATED(new SimpleAttributeDefinition("sip-application-sessions-created", ModelType.INT, false)), + SIP_SESSIONS_CREATION_RATE(new SimpleAttributeDefinition("sip-sessions-per-sec", ModelType.INT, false)), + SIP_APP_SESSIONS_CREATION_RATE(new SimpleAttributeDefinition("sip-application-sessions-per-sec", ModelType.INT, false)), + SIP_SESSION_AVG_ALIVE_TIME(new SimpleAttributeDefinition("sip-session-avg-alive-time", ModelType.INT, false)), + SIP_APP_SESSION_AVG_ALIVE_TIME(new SimpleAttributeDefinition("sip-application-session-avg-alive-time", ModelType.INT, false)), + SIP_SESSION_MAX_ALIVE_TIME(new SimpleAttributeDefinition("sip-session-max-alive-time", ModelType.INT, false)), + SIP_APP_SESSION_MAX_ALIVE_TIME(new SimpleAttributeDefinition("sip-application-session-max-alive-time", ModelType.INT, false)), + REJECTED_SIP_SESSIONS(new SimpleAttributeDefinition("rejected-sip-sessions", ModelType.INT, false)), + REJECTED_SIP_APP_SESSIONS(new SimpleAttributeDefinition("rejected-sip-application-sessions", ModelType.INT, false)), + MAX_ACTIVE_SIP_SESSIONS(new SimpleAttributeDefinition("max-active-sip-sessions", ModelType.INT, false));

private static final Map<String, SessionStat> MAP = new HashMap<String, SessionStat>();

=======================================
--- /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDeploymentServletDefinition.java Sun Jul 8 12:14:07 2012 +++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDeploymentServletDefinition.java Tue Jul 24 13:43:32 2012
@@ -13,7 +13,6 @@
 import org.jboss.as.controller.SimpleResourceDefinition;
 import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
 import org.jboss.as.controller.registry.ManagementResourceRegistration;
-import org.jboss.as.controller.registry.Resource;
 import org.jboss.dmr.ModelNode;
 import org.jboss.dmr.ModelType;
 import org.jboss.msc.service.ServiceController;
@@ -21,8 +20,8 @@
 /**
  * @author Tomaz Cerar
  * @created 23.2.12 18:35
+ * @author [email protected]
  */
-// TODO: josemrecio - check if using virtual-host and context-root make sense public class SipDeploymentServletDefinition extends SimpleResourceDefinition { public static final SipDeploymentServletDefinition INSTANCE = new SipDeploymentServletDefinition();

@@ -80,16 +79,10 @@
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR));

- final Resource web = context.readResourceFromRoot(address.subAddress(0, address.size() - 1), false);
-            final ModelNode subModel = web.getModel();
-
- final String host = subModel.require("virtual-host").asString(); - final String path = subModel.require("context-root").asString();
-
             context.addStep(new OperationStepHandler() {
                 @Override
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { - final ServiceController<?> controller = context.getServiceRegistry(false).getService(SipSubsystemServices.deploymentServiceName(host, path)); + final ServiceController<?> controller = context.getServiceRegistry(false).getService(SipSubsystemServices.deploymentServiceName());
                     if (controller != null) {
final String name = address.getLastElement().getValue(); final Context webContext = Context.class.cast(controller.getValue());
=======================================
--- /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipMessages.java Sun Jul 8 12:14:07 2012 +++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipMessages.java Tue Jul 24 13:43:32 2012
@@ -25,6 +25,7 @@
 import org.jboss.logging.Message;
 import org.jboss.logging.MessageBundle;
 import org.jboss.logging.Messages;
+import org.jboss.vfs.VirtualFile;

 /**
  * Date: 05.11.2011
@@ -53,6 +54,12 @@

     @Message(id = 18009, value = "Error starting sip container")
     String errorStartingSip();
+
+ @Message(id = 18026, value = "Failed to resolve module for deployment %s")
+    String failedToResolveModule(VirtualFile deploymentRoot);
+
+ @Message(id = 18027, value = "Failed to add Mobicents SIP deployment service")
+    String failedToAddSipDeployment();

     /**
      * A message indicating the metric is unknown.
=======================================
--- /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemAdd.java Sun Jul 8 12:14:07 2012 +++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemAdd.java Tue Jul 24 13:43:32 2012
@@ -51,6 +51,7 @@
 import org.mobicents.as7.deployment.SipContextFactoryDeploymentProcessor;
 import org.mobicents.as7.deployment.SipJndiBindingProcessor;
 import org.mobicents.as7.deployment.SipParsingDeploymentProcessor;
+import org.mobicents.as7.deployment.SipWarDeploymentProcessor;

 /**
  * Adds the web subsystem.
@@ -148,6 +149,8 @@
processorTarget.addDeploymentProcessor(SipExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, SIP_CONTEXT_FACTORY_DEPLOYMENT_PRIORITY, SipContextFactoryDeploymentProcessor.INSTANCE); // binds sip resources to JNDI - Before POST_MODULE_INJECTION_ANNOTATION !!! processorTarget.addDeploymentProcessor(SipExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_INJECTION_ANNOTATION - 1, new SipJndiBindingProcessor());
+                // setup management objects for servlets, etc.
+ processorTarget.addDeploymentProcessor(SipExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_WAR_DEPLOYMENT, new SipWarDeploymentProcessor());

 //                // Add the SIP specific deployment processor
// processorTarget.addDeploymentProcessor(Phase.PARSE, DEPLOYMENT_PROCESS_PRIORITY, SipMetaDataDeploymentProcessor.INSTANCE);
=======================================
--- /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemServices.java Sun Jul 8 12:14:07 2012 +++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemServices.java Tue Jul 24 13:43:32 2012
@@ -22,8 +22,8 @@
     /** The base name for jboss.sip deployments. */
static final ServiceName JBOSS_SIP_DEPLOYMENT_BASE = JBOSS_SIP.append("deployment");

- public static ServiceName deploymentServiceName(final String virtualHost, final String contextPath) { - return JBOSS_SIP_DEPLOYMENT_BASE.append(virtualHost).append("".equals(contextPath) ? "/" : contextPath);
+    public static ServiceName deploymentServiceName() {
+       return JBOSS_SIP_DEPLOYMENT_BASE.append("/");
     }

     private SipSubsystemServices() {
=======================================
--- /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/resources/org/mobicents/as7/LocalDescriptions.properties Sun Jul 8 12:14:07 2012 +++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/resources/org/mobicents/as7/LocalDescriptions.properties Tue Jul 24 13:43:32 2012
@@ -44,15 +44,21 @@
sip.deployment.servlet.processingTime=Total execution time of the servlet's service method sip.deployment.servlet.requestCount=Number of requests processed by this servlet

-sip.deployment.context-root=The context root of the web application
-sip.deployment.virtual-host=The name of the virtual host on which the web application is served
-sip.deployment.active-sessions=Number of active sessions
-sip.deployment.expired-sessions=Number of sessions that have expired
-sip.deployment.rejected-sessions=Number of rejected sessions
-sip.deployment.max-active-sessions=Max number of concurrent active sessions
-sip.deployment.sessions-created=Total sessions created
+sip.deployment.active-sip-sessions=Number of active sip sessions
+sip.deployment.active-sip-application-sessions=Number of active sip application sessions +sip.deployment.expired-sip-sessions=Number of sip sessions that have expired +sip.deployment.expired-sip-application-sessions=Number of sip application sessions that have expired
+sip.deployment.rejected-sip-sessions=Number of rejected sip sessions
+sip.deployment.rejected-sip-application-sessions=Number of rejected sip application sessions +sip.deployment.max-active-sip-sessions=Max number of concurrent active sip sessions
+sip.deployment.sip-sessions-created=Total number of sip sessions created
+sip.deployment.sip-application-sessions-created=Total number of sip sessions created +sip.deployment.sip-sessions-per-sec=Number of sip sessions created per second +sip.deployment.sip-application-sessions-per-sec=Number of sip application sessions created per second sip.deployment.duplicated-session-ids=Number of duplicated session IDs generated by the random source (anything \
   bigger than 0 means problems)
-sip.deployment.session-avg-alive-time=Average time (in seconds) that expired sessions had been alive -sip.deployment.session-max-alive-time=The longest time (in seconds) that an expired session had been alive
-
+sip.deployment.sip-session-avg-alive-time=Average time (in seconds) that expired sip sessions had been alive +sip.deployment.sip-application-session-avg-alive-time=Average time (in seconds) that expired sip application sessions had been alive +sip.deployment.sip-session-max-alive-time=The longest time (in seconds) that an expired sip session had been alive +sip.deployment.sip-application-session-max-alive-time=The longest time (in seconds) that an expired sip application session had been alive
+

Reply via email to