Java Doc for RegistryImpl.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » content » 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 » 6.0 JDK Modules » j2me » com.sun.midp.content 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.content.RegistryImpl

RegistryImpl
final public class RegistryImpl (Code)
Implementation of Content Handler registry. It maintains the set of currently registered handlers and updates to the file that holds the permanent set. The RegistryImpl class maintains an array of the current registrations that is initialized on first use.


Field Summary
final  AppProxyapplication
     The AppProxy for this registry.
 intresponseCalls
     Count of responses received.


Method Summary
public  voidcancelGetResponse()
     Cancels a pending getResponse.
static  ContentHandlerImplcheckConflicts(ContentHandlerImpl handler)
     Check for conflicts between a proposed new handler and the existing handlers.
static  voidcleanup(int suiteId, String classname)
     Cleanup as necessary for this classname, both for ContentHandlerServer and the registry.
public  ContentHandler[]findHandler(InvocationImpl invoc)
     Gets the registered content handlers that could be used for this Invocation.
public  ContentHandler[]forAction(String action)
     Gets the registered content handlers that support the action.
public  ContentHandlerforID(String ID, boolean exact)
     Gets the registered content handler for the ID.
public  ContentHandler[]forSuffix(String suffix)
     Gets all of the content handlers for the suffix.
public  ContentHandler[]forType(String type)
     Gets the registered content handlers for the content type.
public  String[]getActions()
     Gets all of the actions of the registered content handlers.
public  StringgetID()
     Gets the content handler ID for the current application.
public  String[]getIDs()
     Gets all of the IDs of the registered content handlers.
public  RegistrygetRegistry()
     Gets the Registry that is delegating to this RegistryImpl.
public static  RegistryImplgetRegistryImpl(String classname, Object token)
     Gets the RegistryImpl for the application class. The SecurityToken is needed to call from the public API package. The application is identified by the classname that implements the lifecycle of the Java runtime environment. The classname must be the name of a registered application class or a registered content handler.

For a MIDP implementation, application classes must be registered with the MIDlet-<n> attribute; content handlers are registered with the MicroEdition-Handler-<n> attribute or the RegistryImpl.register register method.

When the RegistryImpl is created (the first time) all of the existing Invocations are marked.

static  RegistryImplgetRegistryImpl(String classname)
     Gets the RegistryImpl for the application class. The application is identified by the classname that implements the lifecycle of the Java runtime environment. The classname must be the name of a registered application class or a registered content handler.

For a MIDP implementation, application classes must be registered with the MIDlet-<n> attribute; content handlers are registered with the MicroEdition-Handler-<n> attribute or the RegistryImpl.register register method.

When the RegistryImpl is created (the first time) all of the existing Invocations are marked.

public  InvocationgetResponse(boolean wait, InvocationImpl resp)
     Gets the next Invocation response pending for this application. The method blocks until an Invocation response is available, but not for longer than the timeout period. The method can be unblocked with a call to RegistryImpl.cancelGetResponse . The application can process the Invocation based on its status.
public  ContentHandlerImplgetServer()
     Gets the registered content handler for the application class of this RegistryImpl.
 ContentHandlerImplgetServer(AppProxy appl)
     Gets the content handler for the specified application class.
public  String[]getSuffixes()
     Gets all of the suffixes of the registered content handlers.
public  String[]getTypes()
     Gets all of the content types for which there are registered handlers.
public  booleaninvoke(InvocationImpl invocation, InvocationImpl previous)
     Checks the Invocation and uses the ID, type, URL, and action, if present, to find a matching ContentHandler and queues this request to it.

If the previous Invocation is null, then a new transaction is created; otherwise, this Invocation will use the same transaction as the previous Invocation.

The status of this Invocation MUST be INIT. If there is a previous Invocation, that Invocation MUST have a status of ACTIVE.

Candidate content handlers are found as described in RegistryImpl.findHandler findHandler .

static  ContentHandlerImplnewHandler(String classname, String[] types, String[] suffixes, String[] actions, ActionNameMap[] actionnames, String id, String[] accessRestricted, AppProxy appl)
     Create and initialize a new ContentHandler server with type(s), suffix(es), and action(s), action name(s), access restrictions and content handler ID. Compute the application name, ID, and version
Parameters:
  classname - the application class name that implementsthis content handler.
public  ContentHandlerImplregister(String classname, String[] types, String[] suffixes, String[] actions, ActionNameMap[] actionnames, String id, String[] accessRestricted)
     Registers the application class using content type(s), suffix(es), and action(s), action name(s), access restrictions and content handler ID.

An application can use this method to replace or update its own registrations that have the same classname with new information. The update occurs atomically; the update to the registry either occurs or it does not.

The content handler may request to the following items:

  • zero or more content types
  • zero or more suffixes
  • zero or more actions
  • zero or more mappings from actions to action names
  • zero or more access restrictions
  • a optional application ID

If no exceptions are thrown, then the type(s), suffix(s), action(s), action names, and access restrictions, and ID will be registered for the application class.

If an exception is thrown, then the previous registration, if any, will not be removed or modified.
Parameters:
  classname - the application class name that implementsthis content handler.

public  booleanreinvoke(InvocationImpl invocation)
     Reinvokes the Invocation and uses the ID, type, URL, and action to find a matching ContentHandler and re-queues this request to it.
public  voidsetListener(ResponseListener listener)
     Sets the listener to be notified when a new response is available for the application context.
public  voidsetRegistry(Registry newRegistry)
     Sets the Registry that is delegating to this instance.
public  voidsetServer(ContentHandlerImpl server)
     Sets the ContentHandlerImpl; update any active RegistryImpl.
public  booleanunregister(String classname)
     Removes the content handler registration for the application class and any bindings to the content handler name, content type(s), suffix(es), action(s), and access restrictions.

Field Detail
application
final AppProxy application(Code)
The AppProxy for this registry.



responseCalls
int responseCalls(Code)
Count of responses received.





Method Detail
cancelGetResponse
public void cancelGetResponse()(Code)
Cancels a pending getResponse. This method will force a Thread blocked in a call to the getResponse method for the same application context to return early. If no Thread is blocked; this call has no effect.



checkConflicts
static ContentHandlerImpl checkConflicts(ContentHandlerImpl handler) throws ContentHandlerException(Code)
Check for conflicts between a proposed new handler and the existing handlers. If the handler is being replaced it will be returned. Locate and return any existing handler for the same classname.
Parameters:
  handler - the new content handler a ContentHandlerImpl within the suite thatneed to be removed to register the new ContentHandler



cleanup
static void cleanup(int suiteId, String classname)(Code)
Cleanup as necessary for this classname, both for ContentHandlerServer and the registry. Cleanup is required by the fault handling descriptions in javax.microedition.content.ContentHandlerServer .
  • If an Invocation with a status of ACTIVE is dequeued by the content handler, but the handler does not call javax.microedition.content.ContentHandlerServer.finish finish or make a request to chain a new Invocation to the ACTIVE invocation before the content handler exits, then the AMS MUST complete the request with an ERROR status.
  • If the content handler is not running, or exits before processing all queued requests or responses, then it MUST be started. The content handler is expected to dequeue at least one invocation that was queued before it was started. If it does not dequeue any pending Invocations, then Invocations that were in the queue for the content handler before it was started MUST be handled as follows:
    • Invocation requests with a status of ACTIVE are completed with the ERROR status.
    • Invocation responses are discarded.
    • Invocations queued after the content handler was started are retained and will require it to be restarted.

Parameters:
  suiteId - the MIDletSuite to cleanup after
Parameters:
  classname - the application class to cleanup



findHandler
public ContentHandler[] findHandler(InvocationImpl invoc) throws IOException, ContentHandlerException(Code)
Gets the registered content handlers that could be used for this Invocation. Only handlers accessible to the application are considered. The values for ID, type, URL, and action are used in the following order:
  • If the ID is non-null, then the set of candidate handlers is determined from the RegistryImpl.forID forID method with the parameter exact set to false. If there is an exact match it MUST be returned as the first handler. The type and URL are ignored. If there are no handlers that match the requested ID then a ContentHandlerException is thrown.
  • If the ID and type are null and the URL is non-null and If the protocol supports typing of content, then the type is determined as described in Invocation.findType . If the type cannot be determined from the content, the type is set to null.
  • If the ID is null and type is non-null, then the set of candidate handlers is determined from the RegistryImpl.forType forType method. If there are no handlers that match the requested type then a ContentHandlerException is thrown.
  • If both the ID and type are null and the URL is non-null and if the protocol does not support typing of content or the type was not available from the content, then the set of candidate handlers includes any handler with a suffix that matches the end of the path component of the URL. If there are no handlers that match a registered suffix then a ContentHandlerException is thrown.
  • If the ID, type, and URL are all null, the set of candidate handlers includes all of the accessible handlers.
  • If the action is non-null, the set of candidate handlers is reduced to contain only handlers that support the action.
  • If the set of candidate handlers is empty then a ContentHandlerException is thrown.

The calling thread blocks while the ID and type are being determined. If a network access is needed there may be an associated delay.
Parameters:
  invoc - the ID, type, action, and URL thatare needed to identify one or more content handlers;must not be null an array of the ContentHandler(s)that could be used for this Invocation; MUST NOT be null;
exception:
  IOException - is thrown if access to the content fails
exception:
  ContentHandlerException - is thrown with a reason ofNO_REGISTERED_HANDLER ifthere is no registered content handler thatmatches the requested ID, type, URL, and action
exception:
  IllegalArgumentException - is thrown if ID, type, URL,and action are all null orif the content is accessed via the URL and the URL is invalid
exception:
  NullPointerException - is thrown if theinvocation is null
exception:
  SecurityException - is thrown if access to the contentis not permitted




forAction
public ContentHandler[] forAction(String action)(Code)
Gets the registered content handlers that support the action.

Only content handlers that are visible and accessible to this application are returned.
Parameters:
  action - content handlers for which the action is supported an array of the ContentHandlers registeredfor the action; MUST NOT be null;an empty array is returned if no ContentHandlersare accessible to this application
exception:
  NullPointerException - if action isnull




forID
public ContentHandler forID(String ID, boolean exact)(Code)
Gets the registered content handler for the ID. The query can be for an exact match or for the handler matching the prefix of the requested ID.

Only a content handler which is visible to and accessible to this application will be returned.
Parameters:
  ID - the content handler application ID of the contenthandler requested
Parameters:
  exact - true to require an exact match;false to allow a registered content handler IDto match a prefix of the requested ID the content handler that matches the ID,otherwise null
exception:
  NullPointerException - if ID isnull




forSuffix
public ContentHandler[] forSuffix(String suffix)(Code)
Gets all of the content handlers for the suffix. Only content handlers that are visible and accessible to this application are returned.
Parameters:
  suffix - the suffix to be used to get the associatedcontent handlers an array of the ContentHandlers registeredfor the suffix; MUST NOT be null.An empty array is returned if there are none accessible tothis application
exception:
  NullPointerException - if suffix isnull



forType
public ContentHandler[] forType(String type)(Code)
Gets the registered content handlers for the content type.

Only content handlers that are visible and accessible to this application are returned.
Parameters:
  type - the type of the requested content handlers an array of the ContentHandlers registeredfor the type; MUST NOT be null.An empty array is returned if there are noContentHandlers accessible tothis application.
exception:
  NullPointerException - if type isnull




getActions
public String[] getActions()(Code)
Gets all of the actions of the registered content handlers. After a successful registration the content handler's action(s), if any, will appear in this list.

Only content handlers that this application is allowed to access will be included.

an array of content handler actions;MUST NOT be null



getID
public String getID()(Code)
Gets the content handler ID for the current application. The ID uniquely identifies the application which contains the content handler. The application ID is assigned when the application is installed. If the application is a content handler then the ID must be the content handler ID. the ID; MUST NOT be null



getIDs
public String[] getIDs()(Code)
Gets all of the IDs of the registered content handlers.

Only content handlers that this application is allowed to access will be included.

an array of content handler IDs;MUST NOT be null



getRegistry
public Registry getRegistry()(Code)
Gets the Registry that is delegating to this RegistryImpl. a Registry instance
See Also:   RegistryImpl.setRegistry



getRegistryImpl
public static RegistryImpl getRegistryImpl(String classname, Object token) throws ContentHandlerException(Code)
Gets the RegistryImpl for the application class. The SecurityToken is needed to call from the public API package. The application is identified by the classname that implements the lifecycle of the Java runtime environment. The classname must be the name of a registered application class or a registered content handler.

For a MIDP implementation, application classes must be registered with the MIDlet-<n> attribute; content handlers are registered with the MicroEdition-Handler-<n> attribute or the RegistryImpl.register register method.

When the RegistryImpl is created (the first time) all of the existing Invocations are marked. They will be subject to RegistryImpl.cleanup when the MIDlet exits.
Parameters:
  classname - the application class
Parameters:
  token - the security token needed to control access to the impl a RegistryImpl instance providing access to content handlerregistrations and invocations; MUST NOT be null
exception:
  ContentHandlerException - is thrown with a reason ofNO_REGISTERED_HANDLER if there is nocontent handler registered for the classname in the currentapplication
exception:
  NullPointerException - if classname isnull




getRegistryImpl
static RegistryImpl getRegistryImpl(String classname) throws ContentHandlerException(Code)
Gets the RegistryImpl for the application class. The application is identified by the classname that implements the lifecycle of the Java runtime environment. The classname must be the name of a registered application class or a registered content handler.

For a MIDP implementation, application classes must be registered with the MIDlet-<n> attribute; content handlers are registered with the MicroEdition-Handler-<n> attribute or the RegistryImpl.register register method.

When the RegistryImpl is created (the first time) all of the existing Invocations are marked. They will be subject to RegistryImpl.cleanup when the MIDlet exits.
Parameters:
  classname - the application class a RegistryImpl instance providing access to content handlerregistrations and invocations; MUST NOT be null
exception:
  ContentHandlerException - is thrown with a reason ofNO_REGISTERED_HANDLER if there is nocontent handler registered for the classname in the currentapplication
exception:
  NullPointerException - if classname isnull




getResponse
public Invocation getResponse(boolean wait, InvocationImpl resp)(Code)
Gets the next Invocation response pending for this application. The method blocks until an Invocation response is available, but not for longer than the timeout period. The method can be unblocked with a call to RegistryImpl.cancelGetResponse . The application can process the Invocation based on its status. The status is one of OK, CANCELLED, or ERROR.

If the Invocation was invoked with RegistryImpl.invoke(InvocationImpl invocation,InvocationImpl previous) , the getPrevious method MUST return the previous Invocation. If the status of the previous Invocation is HOLD then its status is restored to ACTIVE.

If the original Invocation instance is reachable, then it MUST be updated with the values from the response and be returned to the application. If it is not reachable, then a new instance is returned from getResponse with the response values.
Parameters:
  wait - true if the methodMUST wait for an Invocation if one is not currently available;otherwise false
Parameters:
  resp - an InvocationImpl to fill in with the response
exception:
  IllegalArgumentException - if the context is not valid the next pending response Invocation or nullif the timeout expires and no Invocation is available orif cancelled with RegistryImpl.cancelGetResponse
See Also:   RegistryImpl.invoke
See Also:   RegistryImpl.cancelGetResponse




getServer
public ContentHandlerImpl getServer()(Code)
Gets the registered content handler for the application class of this RegistryImpl. the content handler for the registeredclassname if it was registered by this application.Otherwise, it returns null.
exception:
  NullPointerException - if classname isnull



getServer
ContentHandlerImpl getServer(AppProxy appl)(Code)
Gets the content handler for the specified application class. The classname must be a class in the current application.
Parameters:
  appl - the application to look up a server fro the content handler information for the registeredclassname if the classname was registered by this application,otherwise return null
exception:
  NullPointerException - if classname isnull



getSuffixes
public String[] getSuffixes()(Code)
Gets all of the suffixes of the registered content handlers. After a successful registration the content handler's suffix(es), if any, will appear in this list.

Only content handlers that this application is allowed to access will be included.

an array of content handler suffixes;MUST NOT be null



getTypes
public String[] getTypes()(Code)
Gets all of the content types for which there are registered handlers. After a successful registration, the content handler's type(s), if any, will appear in this list.

Only content handlers that this application is allowed to access will be included.

an array of types; MUST NOT be null



invoke
public boolean invoke(InvocationImpl invocation, InvocationImpl previous) throws IllegalArgumentException, IOException, ContentHandlerException(Code)
Checks the Invocation and uses the ID, type, URL, and action, if present, to find a matching ContentHandler and queues this request to it.

If the previous Invocation is null, then a new transaction is created; otherwise, this Invocation will use the same transaction as the previous Invocation.

The status of this Invocation MUST be INIT. If there is a previous Invocation, that Invocation MUST have a status of ACTIVE.

Candidate content handlers are found as described in RegistryImpl.findHandler findHandler . If any handlers are found, one is selected for this Invocation. The choice of content handler is implemention dependent.

If there is a non-null previous Invocation, its status is set to HOLD. A copy of the Invocation is made, the status is set to ACTIVE and then queued to the target content handler. If the invoked content handler is not running, it MUST be started as described in Invocation Processing.

The calling thread blocks while the content handler is being determined. If a network access is needed, there may be an associated delay.
Parameters:
  invocation - the Invocation containing the target ID, type,actions, arguments, and responseRequired parameters;MUST NOT be null
Parameters:
  previous - a previous Invocation for this Invocation;may be null true if the application MUST firstvoluntarily exit before the content handler can be started;false otherwise
exception:
  IllegalArgumentException - is thrown if:

  • the ID, type, URL, and action are allnull, or
  • the argument array contains any nullreferences

exception:
  IOException - is thrown if access to the content fails
exception:
  ContentHandlerException - is thrown with a reason of:
  • TYPE_UNKNOWN if the typeis not set and cannot be determined from the URL, or
  • NO_REGISTERED_HANDLER ifthere is no registered content handler thatmatches the requested ID, type, url or actions.

exception:
  IllegalStateException - is thrown if the status of thisInvocation is not INIT or if the status of theprevious Invocation, if any, is not ACTIVE
exception:
  NullPointerException - is thrown if theinvocation is null
exception:
  SecurityException - if an invoke operation is not permitted



newHandler
static ContentHandlerImpl newHandler(String classname, String[] types, String[] suffixes, String[] actions, ActionNameMap[] actionnames, String id, String[] accessRestricted, AppProxy appl) throws IllegalArgumentException(Code)
Create and initialize a new ContentHandler server with type(s), suffix(es), and action(s), action name(s), access restrictions and content handler ID. Compute the application name, ID, and version
Parameters:
  classname - the application class name that implementsthis content handler. The value MUST NOT be nulland MUST implement the lifecycle of the Java runtime
Parameters:
  types - an array of types to register;if null it is treated the same as an empty array
Parameters:
  suffixes - an array of suffixes to register;if null it is treated the same as an empty array
Parameters:
  actions - an array of actions to register;if null it is treated the same as an empty array
Parameters:
  actionnames - an array of ActionNameMaps to register;if null it is treated the same as an empty array
Parameters:
  id - the content handler ID; if nulla non-null value MUST be provided by the implementation
Parameters:
  accessRestricted - the IDs of applications and contenthandlers that areallowed visibility and access to this content handler;if null then all applications and contenthandlers are allowed access; if non-null, thenONLY applications and content handlers with matching IDs areallowed access.
Parameters:
  appl - the AppProxy registering the handler the registered ContentHandler; MUST NOT be null
exception:
  NullPointerException - if any of the following items isnull:
  • classname
  • any types, suffixes, actions, actionnames, oraccessRestricted array element
  • ,
  • msuite

exception:
  IllegalArgumentException - can be thrown:
  • if any of the types, suffix,actions, or accessRestrictedstrings have a length of zero, or
  • if the classname does not implement the validlifecycle for the Java Runtime,
  • if the sequence of actions in each ActionNameMapis not the same as the sequence of actions,or
  • if the locales of the ActionNameMaps are not unique, or.
  • if the length of the accessRestrictedarray is zero.
  • .



register
public ContentHandlerImpl register(String classname, String[] types, String[] suffixes, String[] actions, ActionNameMap[] actionnames, String id, String[] accessRestricted) throws SecurityException, IllegalArgumentException, ClassNotFoundException, ContentHandlerException(Code)
Registers the application class using content type(s), suffix(es), and action(s), action name(s), access restrictions and content handler ID.

An application can use this method to replace or update its own registrations that have the same classname with new information. The update occurs atomically; the update to the registry either occurs or it does not.

The content handler may request to the following items:

  • zero or more content types
  • zero or more suffixes
  • zero or more actions
  • zero or more mappings from actions to action names
  • zero or more access restrictions
  • a optional application ID

If no exceptions are thrown, then the type(s), suffix(s), action(s), action names, and access restrictions, and ID will be registered for the application class.

If an exception is thrown, then the previous registration, if any, will not be removed or modified.
Parameters:
  classname - the application class name that implementsthis content handler. The value MUST NOT be nulland MUST implement the lifecycle of the Java runtime
Parameters:
  types - an array of types to register;if null it is treated the same as an empty array
Parameters:
  suffixes - an array of suffixes to register;if null it is treated the same as an empty array
Parameters:
  actions - an array of actions to register;if null it is treated the same as an empty array
Parameters:
  actionnames - an array of ActionNameMaps to register;if null it is treated the same as an empty array
Parameters:
  id - the content handler ID; if nulla non-null value MUST be provided by the implementation
Parameters:
  accessRestricted - the IDs of applications and contenthandlers that areallowed visibility and access to this content handler;if null then all applications and contenthandlers are allowed access; if non-null, thenONLY applications and content handlers with matching IDs areallowed access. the registered ContentHandler; MUST NOT be null
exception:
  NullPointerException - if any of the following items isnull:

  • classname
  • any types, suffixes, actions, actionnames, oraccessRestricted array element

exception:
  IllegalArgumentException - can be thrown:
  • if any of the types, suffix,actions, or accessRestrictedstrings have a length of zero, or
  • if the classname does not implement the validlifecycle for the Java Runtime,
  • if the sequence of actions in each ActionNameMapis not the same as the sequence of actions,or
  • if the locales of the ActionNameMaps are not unique, or.
  • if the length of the accessRestrictedarray is zero.
  • .

exception:
  ClassNotFoundException - if the classnameis not present
exception:
  ContentHandlerException - with a error code ofContentHandlerException.AMBIGUOUS if idis a prefix of any registered handler or if any registeredhandler ID is a prefix of this ID
exception:
  SecurityException - if registrationis not permitted



reinvoke
public boolean reinvoke(InvocationImpl invocation) throws IllegalArgumentException, IOException, ContentHandlerException, SecurityException(Code)
Reinvokes the Invocation and uses the ID, type, URL, and action to find a matching ContentHandler and re-queues this request to it. Reinvocation is used to delegate the handling of an active Invocation to another content handler. The processing of the Invocation instance is complete and the status is set to OK. Responses to the reinvocation will be queued to the original invoking application, if a response is required.

Candidate content handlers are found as described in RegistryImpl.findHandler findHandler . If any handlers are found, one is selected for this Invocation. The choice of content handler is implementation dependent.

The status of this Invocation is set to OK. A copy of the Invocation is made, the status is set to ACTIVE, and then queued to the target content handler. If the invoked content handler application is not running, it MUST be started as described in Invocation Processing.

The calling thread blocks while the content handler is being determined. If a network access is needed there may be an associated delay.
Parameters:
  invocation - an Invocation containing the target ID, type,action, arguments, and responseRequired parameters;MUST NOT be null true if the application MUST firstvoluntarily exit before the content handler can be started;false otherwise
exception:
  IllegalArgumentException - is thrown if:

  • the ID, type, and URL are all null, or
  • the argument array contains any nullreferences

exception:
  IOException - is thrown if access to the content fails
exception:
  ContentHandlerException - is thrown with a reason of:NO_REGISTERED_HANDLER ifthere is no registered content handler thatmatches the requested ID, type, URL, and action
exception:
  NullPointerException - is thrown if theinvocation is null
exception:
  SecurityException - if an invoke operation is notpermitted or if access to the content is not permitted



setListener
public void setListener(ResponseListener listener)(Code)
Sets the listener to be notified when a new response is available for the application context. The request must be retrieved using RegistryImpl.getResponse getResponse .
Parameters:
  listener - the listener to register;null to remove the listener.



setRegistry
public void setRegistry(Registry newRegistry)(Code)
Sets the Registry that is delegating to this instance. Settable only once. Synchronization is performed in javax.microedition.content.Registry.register .
Parameters:
  newRegistry - the Registry delegating to this
See Also:   RegistryImpl.getRegistry



setServer
public void setServer(ContentHandlerImpl server)(Code)
Sets the ContentHandlerImpl; update any active RegistryImpl. Replaces the entry in RegisteredTypes list as well.
Parameters:
  server - the ContentHandlerImpl for this RegistryImpl
See Also:   javax.microedition.content.ContentHandlerServerImpl



unregister
public boolean unregister(String classname)(Code)
Removes the content handler registration for the application class and any bindings to the content handler name, content type(s), suffix(es), action(s), and access restrictions.
Parameters:
  classname - the name of the content handler class if the content handler wassuccessfully removed true is returned,false otherwise
exception:
  NullPointerException - if classname isnull



Methods inherited from java.lang.Object
public boolean equals(Object obj)(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.