Test webapp

adriani.webapp.services
Class ScopeService

java.lang.Object
  extended by adriani.webapp.services.ScopeService

public class ScopeService
extends java.lang.Object

Simple class used to verify how Axis2 handle persistence of the web services instances. This web service can be invoked from the page test_scopeservice.jsp many different times, and as long as the scope is set to "request" the client will get a different object for each request.
Moreover, looking at the Tomcat console output, it's possibile to verify the FIRST INSTANCE of the web service is never finalized. This because at startup Axis2 prepares a pool of all the available web services, to improve performance, hence the first instance is always present.


Field Summary
protected  java.lang.String leadingName
          The leading name of each message logged on the STDOUT.
 
Constructor Summary
ScopeService()
           
 
Method Summary
 void delay()
          Used to delay the service response for about 1 second.
 void destroy(ServiceContext serviceContext)
          This method should be called theoretically, but I have never seen it working.
 java.lang.String echoMessage(java.lang.String msg)
          The method representing the operation offered by this service.
 void finalize()
          Called by the Virtual Machine when this object is destroyed.
 long getThreadID()
          Return the reference ID of the thread running this service.
 void init(ServiceContext serviceContext)
          Called by Axis2 at startup.
 void setOperationContext(OperationContext operationContext)
          This method should be called theoretically, but I have never seen it working.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leadingName

protected java.lang.String leadingName
The leading name of each message logged on the STDOUT.

Constructor Detail

ScopeService

public ScopeService()
Method Detail

echoMessage

public java.lang.String echoMessage(java.lang.String msg)
The method representing the operation offered by this service.

Parameters:
msg - the string message used to produce the response message.

init

public void init(ServiceContext serviceContext)
Called by Axis2 at startup. If the scope is set to application when this method is called the ServiceContext parameter contains a null MessageContext .

Parameters:
serviceContext - the service context handled by Axis2.

delay

public void delay()
Used to delay the service response for about 1 second. This is not needed when calling the service from the test_scopeservice.jsp, but is's needed when testing the multi-threading behaviour. See the test_concurrent.jsp for details.


finalize

public void finalize()
Called by the Virtual Machine when this object is destroyed.

Overrides:
finalize in class java.lang.Object

destroy

public void destroy(ServiceContext serviceContext)
This method should be called theoretically, but I have never seen it working.


setOperationContext

public void setOperationContext(OperationContext operationContext)
This method should be called theoretically, but I have never seen it working.


getThreadID

public long getThreadID()
Return the reference ID of the thread running this service.

Returns:
the ID (as a long integer) of the current thread.

Build 10/01/2013

Morpheus Quality Technologies - making the Zion software
Copyright © 2009-2013 Stefano Adriani. All Rights Reserved