Java Doc for Service.java in  » Web-Server » jo » com » tagtraum » framework » server » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » jo » com.tagtraum.framework.server 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.tagtraum.framework.server.Service

All known Subclasses:   com.tagtraum.metaserver.MetaServer,  com.tagtraum.jobalancer.JoBalancer,  com.tagtraum.jo.JoServletService,
Service
abstract public class Service implements Serializable,I_Service,C_Service(Code)
A Service-implementation.
author:
   Hendrik Schreiber
version:
   1.1beta1 $Id: Service.java,v 1.4 2003/09/13 04:59:56 hendriks73 Exp $
See Also:   com.tagtraum.metaserver.MetaServer
See Also:   TCPService
See Also:   UDPService


Field Summary
protected  intmaxHandlers
     Maximum number of HandlerThreads.
protected  intminHandlers
     Minimum number of HandlerThreads.
protected  booleanmyAlive
     Alive flag.
protected  HashtablemyAttributes
     Attributes.
protected  FactorymyFactory
     Handler factory.
protected  StringmyHandlerClassname
     The Handlers classname.
protected  ConstructormyHandlerConstructor
    
protected  Object[]myHandlerConstructorArgs
    
protected  intmyHandlerCount
     Number of instantiated handlers (ever).
protected transient  HashtablemyListeners
     Listeners.
protected  LogmyLog
     This service's log.
protected  intmyMajorVersion
     Major version number.
protected  intmyMinorVersion
     Minor version number.
protected  StringmyName
     The Service's name.
protected transient  HandlerPoolmyPool
     Handlerpool.
protected  longmyRunningSince
     Running since.
protected  intmySoTimeout
     Socket Timeout.
protected transient  ThreadGroupmyThreadGroup
     Handler ThreadGroup.
protected transient  booleanstopped
     Flag that indicates whether this Service should be stopped.
public static  Stringvcid
    

Constructor Summary
public  Service()
     Default-Constructor.

Method Summary
public synchronized  voidaddListener(I_Listener aListener)
     Adds a Listener.
protected  voiddestroyLongRunningHandlers()
     Method.
public  intgetActiveHandlerCount()
     Returns the number of currently active handlers.
public  ObjectgetAttribute(String key)
     Returns an attribute.
public  EnumerationgetAttributeNames()
     Enumeration of all attribute keys.
public  StringgetGroupId()
    
public  I_HandlergetHandler()
     Returns a ready-to-use I_Handler .
public  StringgetHandlerClassname()
     Return the name of the handler's class.
protected  ConstructorgetHandlerConstructor()
    
protected  Object[]getHandlerConstructorArgs()
    
public  intgetHandlerCount()
     Returns the number of registered handlers.
public  FactorygetHandlerFactory()
     Returns the factory used for instatiating the handlers.
public synchronized  I_ListenergetListener(String aName)
     Returns a listener.
public  intgetMajorVersion()
     Returns a 2 for a service version 2.4.
public  intgetMaxHandlerThreads()
     Returns the max number of Handler s.
public  intgetMinHandlerThreads()
     Returns the min number of Handler s.
public  intgetMinorVersion()
     Returns a 4 for a service version 2.4.
public  StringgetName()
     Returns the name of this Service.
public  intgetPeakActiveHandlerCount()
     Returns the highest number of active handlers that have been used in the past.
public  StringgetServerInfo()
     Returns a server info String.
public  intgetSoTimeout()
     Returns SO_TIMEOUT for the accepting sockets.
public  ThreadGroupgetThreadGroup()
     Gets threadgroup of this Service.
public  StringgetUserId()
    
public  voidhandleSoTimeout()
     Is called when a SO_TIMEOUT happened in one of the I_Listener s.
public synchronized  booleanisAlive()
     Indicates whether this Service is alive or not.
public  booleanisRestartable()
     Indicates whether this server is restartable or not.
public  booleanisStopped()
     Indicates, whether the stopped Flag was set.
public  EnumerationlistenerNames()
     Returns an Enumeration of all listener names.
protected  I_HandlernewHandler()
     Returns a new I_Handler instance.
public  voidrecycleHandler(I_Handler aHandler)
     Recycles a I_Handler .
public synchronized  voidremoveAllListeners()
     Removes all listeners.
public  voidremoveHandler(I_Handler aHandler)
     Unregisteres a Handler from this service.
public synchronized  voidremoveListener(String aName)
     Removes a Listener.
public synchronized  voidrestart()
     Restarts this Service.
public  longrunningSince()
    
public  voidsetAttribute(String key, Object value)
     Sets an attribute.
public  voidsetGroupId(String groupId)
    
public  voidsetHandlerClassname(String aClassname)
     Sets the name of the handler class to use.
public  voidsetHandlerFactory(Factory aFactory)
     Sets the factory used for instatiating the handlers.
public  voidsetMajorVersion(int aVersion)
     Sets the major version for this service.
public  voidsetMaxHandlerThreads(int max)
     Sets the max number of Handler s.
public  voidsetMinHandlerThreads(int min)
     Sets the min number of Handler s.
public  voidsetMinorVersion(int aVersion)
     Sets the minor version for this service.
public  voidsetName(String name)
     Sets the name of this Service.
public  voidsetSoTimeout(int aSoTimeout)
     Sets SO_TIMEOUT for the accepting sockets.
public  voidsetUserId(String userId)
    
public synchronized  voidstart()
     Starts this Service.
public synchronized  voidstop()
     Stops this Service.

Field Detail
maxHandlers
protected int maxHandlers(Code)
Maximum number of HandlerThreads.



minHandlers
protected int minHandlers(Code)
Minimum number of HandlerThreads.



myAlive
protected boolean myAlive(Code)
Alive flag.



myAttributes
protected Hashtable myAttributes(Code)
Attributes.



myFactory
protected Factory myFactory(Code)
Handler factory.



myHandlerClassname
protected String myHandlerClassname(Code)
The Handlers classname.



myHandlerConstructor
protected Constructor myHandlerConstructor(Code)



myHandlerConstructorArgs
protected Object[] myHandlerConstructorArgs(Code)



myHandlerCount
protected int myHandlerCount(Code)
Number of instantiated handlers (ever).



myListeners
protected transient Hashtable myListeners(Code)
Listeners.



myLog
protected Log myLog(Code)
This service's log.



myMajorVersion
protected int myMajorVersion(Code)
Major version number.



myMinorVersion
protected int myMinorVersion(Code)
Minor version number.



myName
protected String myName(Code)
The Service's name.



myPool
protected transient HandlerPool myPool(Code)
Handlerpool.



myRunningSince
protected long myRunningSince(Code)
Running since.



mySoTimeout
protected int mySoTimeout(Code)
Socket Timeout.



myThreadGroup
protected transient ThreadGroup myThreadGroup(Code)
Handler ThreadGroup.



stopped
protected transient boolean stopped(Code)
Flag that indicates whether this Service should be stopped.



vcid
public static String vcid(Code)
Source-Version




Constructor Detail
Service
public Service()(Code)
Default-Constructor. This constructor has to be called in order to initialize data structures etc.




Method Detail
addListener
public synchronized void addListener(I_Listener aListener)(Code)
Adds a Listener.
Parameters:
  aListener - a listener



destroyLongRunningHandlers
protected void destroyLongRunningHandlers()(Code)
Method.



getActiveHandlerCount
public int getActiveHandlerCount()(Code)
Returns the number of currently active handlers. the number of currently active handlers



getAttribute
public Object getAttribute(String key)(Code)
Returns an attribute. the attribute or null, if it doesn't exist.
Parameters:
  key - the attribute's key



getAttributeNames
public Enumeration getAttributeNames()(Code)
Enumeration of all attribute keys. an Enumeration of all attribute keys



getGroupId
public String getGroupId()(Code)



getHandler
public I_Handler getHandler() throws HandlerException(Code)
Returns a ready-to-use I_Handler . a I_Handler
exception:
  HandlerException - if it is not possible to get a I_Handler



getHandlerClassname
public String getHandlerClassname()(Code)
Return the name of the handler's class. the handler's classname



getHandlerConstructor
protected Constructor getHandlerConstructor() throws Exception(Code)
Method declaration
throws:
  Exception -



getHandlerConstructorArgs
protected Object[] getHandlerConstructorArgs()(Code)
Method declaration



getHandlerCount
public int getHandlerCount()(Code)
Returns the number of registered handlers. the number of registered handlers



getHandlerFactory
public Factory getHandlerFactory()(Code)
Returns the factory used for instatiating the handlers. the factory



getListener
public synchronized I_Listener getListener(String aName)(Code)
Returns a listener.
Parameters:
  aName - a listener name a listener or null



getMajorVersion
public int getMajorVersion()(Code)
Returns a 2 for a service version 2.4. major version



getMaxHandlerThreads
public int getMaxHandlerThreads()(Code)
Returns the max number of Handler s. max number of Handlers



getMinHandlerThreads
public int getMinHandlerThreads()(Code)
Returns the min number of Handler s. min number of Handlers



getMinorVersion
public int getMinorVersion()(Code)
Returns a 4 for a service version 2.4. minor version



getName
public String getName()(Code)
Returns the name of this Service. the name of this Service



getPeakActiveHandlerCount
public int getPeakActiveHandlerCount()(Code)
Returns the highest number of active handlers that have been used in the past. the number of currently active handlers



getServerInfo
public String getServerInfo()(Code)
Returns a server info String. a server info string



getSoTimeout
public int getSoTimeout()(Code)
Returns SO_TIMEOUT for the accepting sockets.
Parameters:
  aSoTimeout - time in ms



getThreadGroup
public ThreadGroup getThreadGroup()(Code)
Gets threadgroup of this Service. threadgroup



getUserId
public String getUserId()(Code)



handleSoTimeout
public void handleSoTimeout()(Code)
Is called when a SO_TIMEOUT happened in one of the I_Listener s. Default behavior is trim the HandlerPool to a minimum.
See Also:    #setMinHandlerThreads();



isAlive
public synchronized boolean isAlive()(Code)
Indicates whether this Service is alive or not. true or false



isRestartable
public boolean isRestartable()(Code)
Indicates whether this server is restartable or not. This depends on the user it is run under and the ports it is bound to.



isStopped
public boolean isStopped()(Code)
Indicates, whether the stopped Flag was set. true or false



listenerNames
public Enumeration listenerNames()(Code)
Returns an Enumeration of all listener names. the listener names



newHandler
protected I_Handler newHandler() throws HandlerException(Code)
Returns a new I_Handler instance. a handler
throws:
  HandlerException - if something goes wrong



recycleHandler
public void recycleHandler(I_Handler aHandler)(Code)
Recycles a I_Handler .
Parameters:
  aHandler - I_Handler to recycle



removeAllListeners
public synchronized void removeAllListeners()(Code)
Removes all listeners.



removeHandler
public void removeHandler(I_Handler aHandler)(Code)
Unregisteres a Handler from this service.



removeListener
public synchronized void removeListener(String aName)(Code)
Removes a Listener.
Parameters:
  aName - a listener name



restart
public synchronized void restart() throws ServerException(Code)
Restarts this Service.
exception:
  ServerException - if it is not possible toeither start or stop this Service



runningSince
public long runningSince()(Code)
Returns the time when the service was started the time when the service was started



setAttribute
public void setAttribute(String key, Object value)(Code)
Sets an attribute.
Parameters:
  key - key of this attribute
Parameters:
  value - value of this attribute



setGroupId
public void setGroupId(String groupId)(Code)



setHandlerClassname
public void setHandlerClassname(String aClassname)(Code)
Sets the name of the handler class to use. The class has to implement the interface I_Handler .
Parameters:
  aClassname - the handler classname
See Also:   I_Handler



setHandlerFactory
public void setHandlerFactory(Factory aFactory)(Code)
Sets the factory used for instatiating the handlers.
Parameters:
  aFactory - the factory



setMajorVersion
public void setMajorVersion(int aVersion)(Code)
Sets the major version for this service.
Parameters:
  aVersion - major version



setMaxHandlerThreads
public void setMaxHandlerThreads(int max)(Code)
Sets the max number of Handler s.
Parameters:
  max - max number of Handlers



setMinHandlerThreads
public void setMinHandlerThreads(int min)(Code)
Sets the min number of Handler s.
Parameters:
  min - min number of Handlers



setMinorVersion
public void setMinorVersion(int aVersion)(Code)
Sets the minor version for this service.
Parameters:
  aVersion - minor version



setName
public void setName(String name)(Code)
Sets the name of this Service.
Parameters:
  name - name of this Service



setSoTimeout
public void setSoTimeout(int aSoTimeout)(Code)
Sets SO_TIMEOUT for the accepting sockets.
Parameters:
  aSoTimeout - time in ms



setUserId
public void setUserId(String userId)(Code)



start
public synchronized void start() throws ServerException(Code)
Starts this Service.
exception:
  ServerException - if it is not possible tostart this Service



stop
public synchronized void stop() throws ServerException(Code)
Stops this Service.
exception:
  ServerException - if it is not possible tostop this Service



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.