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


org.apache.turbine.services.TurbineBaseService
   org.apache.turbine.services.factory.TurbineFactoryService

TurbineFactoryService
public class TurbineFactoryService extends TurbineBaseService implements FactoryService(Code)
The Factory Service instantiates objects using specified class loaders. If none is specified, the default one will be used.
author:
   Ilkka Priha
version:
   $Id: TurbineFactoryService.java 534527 2007-05-02 16:10:59Z tv $


Field Summary
final public static  StringCLASS_LOADERS
     The property specifying a set of additional class loaders.
final public static  StringOBJECT_FACTORY
     The property prefix specifying additional object factories.

Constructor Summary
public  TurbineFactoryService()
     Constructs a Factory Service.

Method Summary
protected  FactorygetFactory(String className)
     Gets a customized factory for a named class.
Parameters:
  className - the name of the class to load.
public  ObjectgetInstance(String className)
     Gets an instance of a named class.
Parameters:
  className - the name of the class.
public  ObjectgetInstance(String className, ClassLoader loader)
     Gets an instance of a named class using a specified class loader.

Class loaders are supported only if the isLoaderSupported method returns true.

public  ObjectgetInstance(String className, Object[] params, String[] signature)
     Gets an instance of a named class. Parameters for its constructor are given as an array of objects, primitive types must be wrapped with a corresponding class.
Parameters:
  className - the name of the class.
Parameters:
  params - an array containing the parameters of the constructor.
Parameters:
  signature - an array containing the signature of the constructor.
public  ObjectgetInstance(String className, ClassLoader loader, Object[] params, String[] signature)
     Gets an instance of a named class using a specified class loader. Parameters for its constructor are given as an array of objects, primitive types must be wrapped with a corresponding class.

Class loaders are supported only if the isLoaderSupported method returns true.

protected  ObjectgetInstance(Class clazz)
     Gets an instance of a specified class.
Parameters:
  clazz - the class.
protected  ObjectgetInstance(Class clazz, Object params, String signature)
     Gets an instance of a specified class. Parameters for its constructor are given as an array of objects, primitive types must be wrapped with a corresponding class.
Parameters:
  clazz - the class.
Parameters:
  params - an array containing the parameters of the constructor.
Parameters:
  signature - an array containing the signature of the constructor.
protected static  ClassgetPrimitiveClass(String type)
     Gets the class of a primitive type.
Parameters:
  type - a primitive type.
public  Class[]getSignature(Class clazz, Object params, String signature)
     Gets the signature classes for parameters of a method of a class.
Parameters:
  clazz - the class.
Parameters:
  params - an array containing the parameters of the method.
Parameters:
  signature - an array containing the signature of the method.
public  voidinit()
     Initializes the service by loading default class loaders and customized object factories.
public  booleanisLoaderSupported(String className)
     Tests if specified class loaders are supported for a named class.
Parameters:
  className - the name of the class.
protected  ClassloadClass(String className)
     Loads the named class using the default class loader.
Parameters:
  className - the name of the class to load.
protected  ClassloadClass(String className, ClassLoader loader)
     Loads the named class using a specified class loader.
Parameters:
  className - the name of the class to load.
Parameters:
  loader - the loader to use.
protected  ObjectswitchObjectContext(Object object, ClassLoader loader)
     Switches an object into the context of a different class loader.

Field Detail
CLASS_LOADERS
final public static String CLASS_LOADERS(Code)
The property specifying a set of additional class loaders.



OBJECT_FACTORY
final public static String OBJECT_FACTORY(Code)
The property prefix specifying additional object factories.




Constructor Detail
TurbineFactoryService
public TurbineFactoryService()(Code)
Constructs a Factory Service.




Method Detail
getFactory
protected Factory getFactory(String className) throws TurbineException(Code)
Gets a customized factory for a named class.
Parameters:
  className - the name of the class to load. the factory or null if not specified.
throws:
  TurbineException - if instantiation of the factory fails.



getInstance
public Object getInstance(String className) throws TurbineException(Code)
Gets an instance of a named class.
Parameters:
  className - the name of the class. the instance.
throws:
  TurbineException - if instantiation fails.



getInstance
public Object getInstance(String className, ClassLoader loader) throws TurbineException(Code)
Gets an instance of a named class using a specified class loader.

Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
Parameters:
  className - the name of the class.
Parameters:
  loader - the class loader. the instance.
throws:
  TurbineException - if instantiation fails.




getInstance
public Object getInstance(String className, Object[] params, String[] signature) throws TurbineException(Code)
Gets an instance of a named class. Parameters for its constructor are given as an array of objects, primitive types must be wrapped with a corresponding class.
Parameters:
  className - the name of the class.
Parameters:
  params - an array containing the parameters of the constructor.
Parameters:
  signature - an array containing the signature of the constructor. the instance.
throws:
  TurbineException - if instantiation fails.



getInstance
public Object getInstance(String className, ClassLoader loader, Object[] params, String[] signature) throws TurbineException(Code)
Gets an instance of a named class using a specified class loader. Parameters for its constructor are given as an array of objects, primitive types must be wrapped with a corresponding class.

Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
Parameters:
  className - the name of the class.
Parameters:
  loader - the class loader.
Parameters:
  params - an array containing the parameters of the constructor.
Parameters:
  signature - an array containing the signature of the constructor. the instance.
throws:
  TurbineException - if instantiation fails.




getInstance
protected Object getInstance(Class clazz) throws TurbineException(Code)
Gets an instance of a specified class.
Parameters:
  clazz - the class. the instance.
throws:
  TurbineException - if instantiation fails.



getInstance
protected Object getInstance(Class clazz, Object params, String signature) throws TurbineException(Code)
Gets an instance of a specified class. Parameters for its constructor are given as an array of objects, primitive types must be wrapped with a corresponding class.
Parameters:
  clazz - the class.
Parameters:
  params - an array containing the parameters of the constructor.
Parameters:
  signature - an array containing the signature of the constructor. the instance.
throws:
  TurbineException - if instantiation fails.



getPrimitiveClass
protected static Class getPrimitiveClass(String type)(Code)
Gets the class of a primitive type.
Parameters:
  type - a primitive type. the corresponding class, or null.



getSignature
public Class[] getSignature(Class clazz, Object params, String signature) throws ClassNotFoundException(Code)
Gets the signature classes for parameters of a method of a class.
Parameters:
  clazz - the class.
Parameters:
  params - an array containing the parameters of the method.
Parameters:
  signature - an array containing the signature of the method. an array of signature classes. Note that in some casesobjects in the parameter array can be switched to the contextof a different class loader.
throws:
  ClassNotFoundException - if any of the classes is not found.



init
public void init() throws InitializationException(Code)
Initializes the service by loading default class loaders and customized object factories.
throws:
  InitializationException - if initialization fails.



isLoaderSupported
public boolean isLoaderSupported(String className) throws TurbineException(Code)
Tests if specified class loaders are supported for a named class.
Parameters:
  className - the name of the class. true if class loaders are supported, false otherwise.
throws:
  TurbineException - if test fails.



loadClass
protected Class loadClass(String className) throws ClassNotFoundException(Code)
Loads the named class using the default class loader.
Parameters:
  className - the name of the class to load. the loaded class.
throws:
  ClassNotFoundException - if the class was not found.



loadClass
protected Class loadClass(String className, ClassLoader loader) throws ClassNotFoundException(Code)
Loads the named class using a specified class loader.
Parameters:
  className - the name of the class to load.
Parameters:
  loader - the loader to use. the loaded class.
throws:
  ClassNotFoundException - if the class was not found.



switchObjectContext
protected Object switchObjectContext(Object object, ClassLoader loader)(Code)
Switches an object into the context of a different class loader.
Parameters:
  object - an object to switch.
Parameters:
  loader - the loader of the new context.



Methods inherited from org.apache.turbine.services.TurbineBaseService
public void init(Object data) throws InitializationException(Code)(Java Doc)
public void init(ServletConfig config) throws InitializationException(Code)(Java Doc)
public void init(RunData data) throws InitializationException(Code)(Java Doc)
public void init() throws InitializationException(Code)(Java Doc)
public void shutdown()(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.