Java Doc for API.java in  » Web-Services » xins » org » xins » 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 Services » xins » org.xins.server 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.xins.common.manageable.Manageable
      org.xins.server.API

API
abstract public class API extends Manageable (Code)
Base class for API implementation classes.
version:
   $Revision: 1.369 $ $Date: 2007/09/18 08:45:06 $
author:
   Ernst de Haan
author:
   Anthony Goubard
author:
   Tauseef Rehman
since:
   XINS 1.0.0


Field Summary
final static  StringAPI_VERSION_PROPERTY
     The name of the bootstrap property that specifies the version of the API.
final static  FunctionResultSUCCESSFUL_RESULT
     Successful empty call result.

Constructor Summary
protected  API(String name)
     Constructs a new API object.

Method Summary
final protected  voidadd(Manageable m)
     Adds the specified manageable object.
public  booleanallow(String ip, String functionName, String conventionName)
     Determines if the specified IP address is allowed to access the specified function, returning a boolean value.

This method finds the first matching rule and then returns the allow property of that rule (see AccessRule.isAllowRule ).

final protected  voidbootstrapImpl(PropertyReader buildSettings)
     Bootstraps this API (wrapper method).
protected  voidbootstrapImpl2(PropertyReader buildSettings)
     Bootstraps this API (implementation method).

The implementation of this method in class API is empty. Custom subclasses can perform any necessary bootstrapping in this class.

Note that bootstrapping and initialization are different.

final protected  voiddeinitImpl()
     Performs shutdown of this XINS API.
final  voidfunctionAdded(Function function)
     Callback method invoked when a function is constructed.
final public  APISpecgetAPISpecification()
     Get the specification of the API.
public  PropertyReadergetBootstrapProperties()
     Gets the bootstrap properties specified for the API.
final  FunctiongetFunction(String name)
     Returns the function with the specified name.
final public  ListgetFunctionList()
     Gets the list of the functions of this API.
final public  StringgetName()
     Gets the name of this API.
public  RuntimePropertiesgetProperties()
     Gets the runtime properties specified in the implementation.
final public  InputStreamgetResourceAsStream(String path)
     Gets the resource in the WAR file.
 PropertyReadergetRuntimeProperties()
     Gets the API runtime properties.
final public  longgetStartupTimestamp()
     Gets the timestamp that indicates when this API instance was created.
final public  TimeZonegetTimeZone()
     Returns the applicable time zone.
final  FunctionResulthandleCall(long start, FunctionRequest functionRequest, String ip, CallingConvention cc)
     Forwards a call to a function, using an IP address.
 FunctionResulthandleFunctionException(long start, FunctionRequest functionRequest, String ip, int callID, Throwable exception)
     Handles an exception caught while a function was executed.
final protected  voidinitImpl(PropertyReader runtimeSettings)
     Initializes this API.
 booleanisDisabled()
     Indicates whether the API is down for maintenance or not.
final protected  voidreinitializeImpl()
     Triggers re-initialization of this API.
 voidsetEngine(Engine engine)
     Stores a reference to the Engine that owns this API object.

Field Detail
API_VERSION_PROPERTY
final static String API_VERSION_PROPERTY(Code)
The name of the bootstrap property that specifies the version of the API.



SUCCESSFUL_RESULT
final static FunctionResult SUCCESSFUL_RESULT(Code)
Successful empty call result.




Constructor Detail
API
protected API(String name) throws IllegalArgumentException(Code)
Constructs a new API object.
Parameters:
  name - the name of the API, cannot be null nor can it be anempty string.
throws:
  IllegalArgumentException - if name == null|| name.String.length length() < 1.




Method Detail
add
final protected void add(Manageable m) throws IllegalStateException, IllegalArgumentException(Code)
Adds the specified manageable object. It will not immediately be bootstrapped and initialized.
Parameters:
  m - the manageable object to add, not null.
throws:
  IllegalStateException - if this API is currently not bootstrapping.
throws:
  IllegalArgumentException - if instance == null.



allow
public boolean allow(String ip, String functionName, String conventionName) throws IllegalArgumentException(Code)
Determines if the specified IP address is allowed to access the specified function, returning a boolean value.

This method finds the first matching rule and then returns the allow property of that rule (see AccessRule.isAllowRule ). If there is no matching rule, then false is returned.
Parameters:
  ip - the IP address, cannot be null.
Parameters:
  functionName - the name of the function, cannot be null.
Parameters:
  conventionName - the name of the calling convention, can be null.true if the request is allowed, false ifthe request is denied.
throws:
  IllegalArgumentException - if ip == null || functionName == null.
since:
   XINS 2.1.




bootstrapImpl
final protected void bootstrapImpl(PropertyReader buildSettings) throws IllegalStateException, MissingRequiredPropertyException, InvalidPropertyValueException, BootstrapException(Code)
Bootstraps this API (wrapper method). This method calls API.bootstrapImpl2(PropertyReader) .
Parameters:
  buildSettings - the build-time configuration properties, not null.
throws:
  IllegalStateException - if this API is currently not bootstraping.
throws:
  MissingRequiredPropertyException - if a required property is not given.
throws:
  InvalidPropertyValueException - if a property has an invalid value.
throws:
  BootstrapException - if the bootstrap fails.



bootstrapImpl2
protected void bootstrapImpl2(PropertyReader buildSettings) throws MissingRequiredPropertyException, InvalidPropertyValueException, BootstrapException(Code)
Bootstraps this API (implementation method).

The implementation of this method in class API is empty. Custom subclasses can perform any necessary bootstrapping in this class.

Note that bootstrapping and initialization are different. Bootstrap includes only the one-time configuration of the API based on the build-time settings, while the initialization

The API.add(Manageable) may be called from this method, and from this method only.
Parameters:
  buildSettings - the build-time properties, guaranteed not to be null.
throws:
  MissingRequiredPropertyException - if a required property is not given.
throws:
  InvalidPropertyValueException - if a property has an invalid value.
throws:
  BootstrapException - if the bootstrap fails.




deinitImpl
final protected void deinitImpl()(Code)
Performs shutdown of this XINS API. This method will never throw any exception.



functionAdded
final void functionAdded(Function function) throws NullPointerException, IllegalStateException(Code)
Callback method invoked when a function is constructed.
Parameters:
  function - the function that is added, not null.
throws:
  NullPointerException - if function == null.
throws:
  IllegalStateException - if this API state is incorrect.



getAPISpecification
final public APISpec getAPISpecification() throws InvalidSpecificationException(Code)
Get the specification of the API. the APISpec specification object, never null.
throws:
  InvalidSpecificationException - if the specification cannot be found or is invalid.
since:
   XINS 1.3.0



getBootstrapProperties
public PropertyReader getBootstrapProperties()(Code)
Gets the bootstrap properties specified for the API. the bootstrap properties, cannot be null.
since:
   XINS 1.5.0.



getFunction
final Function getFunction(String name)(Code)
Returns the function with the specified name.
Parameters:
  name - the name of the function, will not be checked if it isnull.the function with the specified name, or null if thereis no match.



getFunctionList
final public List getFunctionList()(Code)
Gets the list of the functions of this API. the functions of this API as a List of Function objects, never null.
since:
   XINS 1.5.0.



getName
final public String getName()(Code)
Gets the name of this API. the name of this API, never null and never an emptystring.



getProperties
public RuntimeProperties getProperties()(Code)
Gets the runtime properties specified in the implementation. the runtime properties for the API, cannot be null.



getResourceAsStream
final public InputStream getResourceAsStream(String path) throws IllegalArgumentException(Code)
Gets the resource in the WAR file.
Parameters:
  path - the path for the resource, cannot be null and should start with /.the InputStream to use to read this resource or null ifthe resource cannot be found.
throws:
  IllegalArgumentException - if path == null or if the path doesn't start with /.
since:
   XINS 2.0.



getRuntimeProperties
PropertyReader getRuntimeProperties()(Code)
Gets the API runtime properties. the runtime properties, cannot be null.



getStartupTimestamp
final public long getStartupTimestamp()(Code)
Gets the timestamp that indicates when this API instance was created. the time this instance was constructed, as a number of millisecondssince theUNIX Epoch.



getTimeZone
final public TimeZone getTimeZone()(Code)
Returns the applicable time zone. the time zone, never null.



handleCall
final FunctionResult handleCall(long start, FunctionRequest functionRequest, String ip, CallingConvention cc) throws IllegalStateException, NullPointerException, NoSuchFunctionException, AccessDeniedException(Code)
Forwards a call to a function, using an IP address. The call will actually be handled by Function.handleCall(longFunctionRequestString) .
Parameters:
  start - the start time of the request, in milliseconds since theUNIX Epoch.
Parameters:
  functionRequest - the function request, never null.
Parameters:
  ip - the remote IP address, never null.
Parameters:
  cc - the calling convention to use to handle the call, never null.the result of the call, never null.
throws:
  IllegalStateException - if this object is currently not initialized.
throws:
  NullPointerException - if functionRequest == null.
throws:
  NoSuchFunctionException - if there is no matching function for the specified request.
throws:
  AccessDeniedException - if access is denied for the specified combination of IP address andfunction name.



handleFunctionException
FunctionResult handleFunctionException(long start, FunctionRequest functionRequest, String ip, int callID, Throwable exception)(Code)
Handles an exception caught while a function was executed.
Parameters:
  start - the start time of the call, as milliseconds since theUNIX Epoch.
Parameters:
  functionRequest - the request, never null.
Parameters:
  ip - the IP address of the requester, never null.
Parameters:
  callID - the call identifier, never null.
Parameters:
  exception - the exception caught, never null.the call result, never null.



initImpl
final protected void initImpl(PropertyReader runtimeSettings) throws MissingRequiredPropertyException, InvalidPropertyValueException, InitializationException, IllegalStateException(Code)
Initializes this API.
Parameters:
  runtimeSettings - the runtime configuration settings, cannot be null.
throws:
  MissingRequiredPropertyException - if a required property is missing.
throws:
  InvalidPropertyValueException - if a property has an invalid value.
throws:
  InitializationException - if the initialization failed for some other reason.
throws:
  IllegalStateException - if this API is currently not initializing.



isDisabled
boolean isDisabled()(Code)
Indicates whether the API is down for maintenance or not. true if the API is disable, false otherwise.



reinitializeImpl
final protected void reinitializeImpl()(Code)
Triggers re-initialization of this API. This method is meant to be called by API function implementations when it is anticipated that the API should be re-initialized.



setEngine
void setEngine(Engine engine)(Code)
Stores a reference to the Engine that owns this API object.
Parameters:
  engine - the Engine instance, should not be null.



Fields inherited from org.xins.common.manageable.Manageable
final public static State BOOTSTRAPPED(Code)(Java Doc)
final public static State BOOTSTRAPPING(Code)(Java Doc)
final public static State DEINITIALIZING(Code)(Java Doc)
final public static State INITIALIZING(Code)(Java Doc)
final public static State UNUSABLE(Code)(Java Doc)
final public static State USABLE(Code)(Java Doc)

Methods inherited from org.xins.common.manageable.Manageable
final protected void assertUsable() throws IllegalStateException(Code)(Java Doc)
final public void bootstrap(PropertyReader properties) throws IllegalStateException, MissingRequiredPropertyException, InvalidPropertyValueException, BootstrapException(Code)(Java Doc)
protected void bootstrapImpl(PropertyReader properties) throws MissingRequiredPropertyException, InvalidPropertyValueException, BootstrapException(Code)(Java Doc)
final public void deinit() throws IllegalStateException, DeinitializationException(Code)(Java Doc)
protected void deinitImpl() throws Throwable(Code)(Java Doc)
final public State getState()(Code)(Java Doc)
final public void init(PropertyReader properties) throws IllegalStateException, MissingRequiredPropertyException, InvalidPropertyValueException, InitializationException(Code)(Java Doc)
protected void initImpl(PropertyReader properties) throws MissingRequiredPropertyException, InvalidPropertyValueException, InitializationException(Code)(Java Doc)
final public boolean isBootstrapped()(Code)(Java Doc)
final public boolean isUsable()(Code)(Java Doc)

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.