Java Doc for BaseServiceBroker.java in  » Web-Framework » TURBINE » org » apache » turbine » services » 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 Framework » TURBINE » org.apache.turbine.services 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.turbine.services.BaseServiceBroker

All known Subclasses:   org.apache.turbine.services.TurbineServices,
BaseServiceBroker
abstract public class BaseServiceBroker implements ServiceBroker(Code)
A generic implementation of a ServiceBroker which provides:
  • Maintaining service name to class name mapping, allowing plugable service implementations.
  • Providing Services with a configuration based on system wide configuration mechanism.

author:
   Kevin Burton
author:
   Rafal Krzewski
author:
   Daniel Rall
author:
   Jason van Zyl
author:
   Martin Poeschl
author:
   Henning P. Schmiedehausen
version:
   $Id: BaseServiceBroker.java 534527 2007-05-02 16:10:59Z tv $


Field Summary
final public static  StringCLASSNAME_SUFFIX
     A Service property determining its implementing class name .
final public static  StringSERVICE_PREFIX
     A prefix for Service properties in TurbineResource.properties.
protected  StringapplicationRoot
     Application root path as set by the parent application.
protected  Configurationconfiguration
     Configuration for the services broker.
protected  Configurationmapping
     Mapping of Service names to class names.
protected  HashtableserviceObjects
     These are objects that the parent application can provide so that application specific services have a mechanism to retrieve specialized information.
protected  Hashtableservices
     A repository of Service instances.

Constructor Summary
protected  BaseServiceBroker()
     Default constructor, protected as to only be useable by subclasses.

Method Summary
public  StringgetApplicationRoot()
     Get the application root as set by the parent application.
public  ConfigurationgetConfiguration()
     Get the configuration for this service manager.
public  ConfigurationgetConfiguration(String name)
     Returns the configuration for the specified service.
Parameters:
  name - The name of the service.
public  ServicegetService(String name)
     Returns an instance of requested Service.
Parameters:
  name - The name of the Service requested.
protected  ServicegetServiceInstance(String name)
     Retrieves an instance of a Service without triggering late initialization. Early initialization of a Service can require access to Service properties.
public  IteratorgetServiceNames()
     Returns an Iterator over all known service names.
public  IteratorgetServiceNames(String prefix)
     Returns an Iterator over all known service names beginning with the provided prefix.
Parameters:
  prefix - The prefix against which to test.
public  ObjectgetServiceObject(String name)
     Get an application specific service object.
public  voidinit()
     Initialize this service manager.
protected  voidinitMapping()
     Creates a mapping between Service names and class names. The mapping is built according to settings present in TurbineResources.properties.
public synchronized  voidinitService(String name)
     Performs early initialization of specified service.
public  voidinitServices()
     Performs early initialization of all services.
public  voidinitServices(boolean report)
     Performs early initialization of all services.
public  booleanisRegistered(String serviceName)
     Determines whether a service is registered in the configured TurbineResources.properties.
Parameters:
  serviceName - The name of the service whose existance to check.
public  voidsetApplicationRoot(String applicationRoot)
     Set the application root.
public  voidsetConfiguration(Configuration configuration)
     Set the configuration object for the services broker.
public  voidsetServiceObject(String name, Object value)
     Set an application specific service object that can be used by application specific services.
public synchronized  voidshutdownService(String name)
     Shuts down a Service, releasing resources allocated by an Service, and returns it to its initial (uninitialized) state.
public  voidshutdownServices()
     Shuts down all Turbine services, releasing allocated resources and returning them to their initial (uninitialized) state.

Field Detail
CLASSNAME_SUFFIX
final public static String CLASSNAME_SUFFIX(Code)
A Service property determining its implementing class name .



SERVICE_PREFIX
final public static String SERVICE_PREFIX(Code)
A prefix for Service properties in TurbineResource.properties.



applicationRoot
protected String applicationRoot(Code)
Application root path as set by the parent application.



configuration
protected Configuration configuration(Code)
Configuration for the services broker. The configuration should be set by the application in which the services framework is running.



mapping
protected Configuration mapping(Code)
Mapping of Service names to class names.



serviceObjects
protected Hashtable serviceObjects(Code)
These are objects that the parent application can provide so that application specific services have a mechanism to retrieve specialized information. For example, in Turbine there are services that require the RunData object: these services can retrieve the RunData object that Turbine has placed in the service manager. This alleviates us of the requirement of having init(Object) all together.



services
protected Hashtable services(Code)
A repository of Service instances.




Constructor Detail
BaseServiceBroker
protected BaseServiceBroker()(Code)
Default constructor, protected as to only be useable by subclasses. This constructor does nothing.




Method Detail
getApplicationRoot
public String getApplicationRoot()(Code)
Get the application root as set by the parent application. String application root



getConfiguration
public Configuration getConfiguration()(Code)
Get the configuration for this service manager. Broker configuration.



getConfiguration
public Configuration getConfiguration(String name)(Code)
Returns the configuration for the specified service.
Parameters:
  name - The name of the service. Configuration of requested Service.



getService
public Service getService(String name) throws InstantiationException(Code)
Returns an instance of requested Service.
Parameters:
  name - The name of the Service requested. An instance of requested Service.
exception:
  InstantiationException - if the service is unknown orcan't be initialized.



getServiceInstance
protected Service getServiceInstance(String name) throws InstantiationException(Code)
Retrieves an instance of a Service without triggering late initialization. Early initialization of a Service can require access to Service properties. The Service must have its name and serviceBroker set by then. Therefore, before calling Initable.initClass(Object), the class must be instantiated with InitableBroker.getInitableInstance(), and Service.setServiceBroker() and Service.setName() must be called. This calls for two - level accessing the Services instances.
Parameters:
  name - The name of the service requested.
exception:
  InstantiationException - The service is unknown orcan't be initialized.



getServiceNames
public Iterator getServiceNames()(Code)
Returns an Iterator over all known service names. An Iterator of service names.



getServiceNames
public Iterator getServiceNames(String prefix)(Code)
Returns an Iterator over all known service names beginning with the provided prefix.
Parameters:
  prefix - The prefix against which to test. An Iterator of service names which match the prefix.



getServiceObject
public Object getServiceObject(String name)(Code)
Get an application specific service object. Object application specific service object



init
public void init() throws InitializationException(Code)
Initialize this service manager.



initMapping
protected void initMapping()(Code)
Creates a mapping between Service names and class names. The mapping is built according to settings present in TurbineResources.properties. The entries should have the following form:
 services.MyService.classname=com.mycompany.MyServiceImpl
 services.MyOtherService.classname=com.mycompany.MyOtherServiceImpl
 

Generic ServiceBroker provides no Services.



initService
public synchronized void initService(String name) throws InitializationException(Code)
Performs early initialization of specified service.
Parameters:
  name - The name of the service (generally theSERVICE_NAME constant of the service's interfacedefinition).
exception:
  InitializationException - Initialization of thisservice was not successful.



initServices
public void initServices()(Code)
Performs early initialization of all services. Failed early initialization of a Service may be non-fatal to the system, thus any exceptions are logged and the initialization process continues.



initServices
public void initServices(boolean report) throws InstantiationException, InitializationException(Code)
Performs early initialization of all services. You can decide to handle failed initializations if you wish, but then after one service fails, the other will not have the chance to initialize.
Parameters:
  report - true if you want exceptions thrown.



isRegistered
public boolean isRegistered(String serviceName)(Code)
Determines whether a service is registered in the configured TurbineResources.properties.
Parameters:
  serviceName - The name of the service whose existance to check. Registration predicate for the desired services.



setApplicationRoot
public void setApplicationRoot(String applicationRoot)(Code)
Set the application root.
Parameters:
  applicationRoot - application root



setConfiguration
public void setConfiguration(Configuration configuration)(Code)
Set the configuration object for the services broker. This is the configuration that contains information about all services in the care of this service manager.
Parameters:
  configuration - Broker configuration.



setServiceObject
public void setServiceObject(String name, Object value)(Code)
Set an application specific service object that can be used by application specific services.
Parameters:
  name - name of service object
Parameters:
  value - value of service object



shutdownService
public synchronized void shutdownService(String name)(Code)
Shuts down a Service, releasing resources allocated by an Service, and returns it to its initial (uninitialized) state.
Parameters:
  name - The name of the Service to beuninitialized.



shutdownServices
public void shutdownServices()(Code)
Shuts down all Turbine services, releasing allocated resources and returning them to their initial (uninitialized) state.



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.