Java Doc for ApplicationEventBroker.java in  » Workflow-Engines » obe-1.0 » org » obe » spi » service » 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 » Workflow Engines » obe 1.0 » org.obe.spi.service 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.obe.spi.service.ApplicationEventBroker

All known Subclasses:   org.obe.event.AbstractApplicationEventBroker,
ApplicationEventBroker
public interface ApplicationEventBroker extends WorkflowService(Code)
Provides access to temporal events and external events originating in third party applications.

The workflow engine subscribes to events by specifying the event type, an optional set of event keys, an optional predicate, and a set of correlation keys. The combination of event type, event keys and predicate are used to discriminate the precise event instance to which the engine is subscribing. The correlation keys encapsulate the workflow context and typically contain between one and four strings: processDefinitionId, processInstanceId, activityInstanceId and transitionId. All elements of the array must be non-null.

This somewhat complex scheme is intended to enhance performance, since in a production system the alternative of evaluating large numbers of simple expressions would not perform well. The event type definitions and the expressions used to compute the key values from the inbound event data are registered in the event broker.

When unsubscribing, all existing subscriptions which match the array of correlation keys are cancelled, even if it contains fewer elements than the existing subscription. This enables a process instance, for example, to cancel all outstanding subscriptions in one call by passing just the processDefinitionId and processInstanceId.
author:
   Adrian Price
See Also:   ApplicationEvent
See Also:   ApplicationEventListener


Inner Class :interface EventSubscription
Inner Class :interface ApplicationEventSubscription extends EventSubscription
Inner Class :interface TemporalEventSubscription extends EventSubscription

Field Summary
 StringSERVICE_NAME
    


Method Summary
 voidaddApplicationEventListener(ApplicationEventListener listener)
     Adds an application event listener.
 voidcreateEventType(EventTypeMetaData eventType)
     Registers an application event type.
 voiddeleteEventType(String eventType)
     Unregisters an application event type.
 EventTypeMetaData[]findEventTypeMetaData()
     Finds meta-data for all application event types.
 EventTypeMetaDatafindEventTypeMetaData(String eventId)
     Finds meta-data for a specific application event type.
Parameters:
  eventId - The application event ID.
 voidfireApplicationEvent(ApplicationEvent event, String[] correlationKeys)
     Notifies listeners of an event which matches the specified correlation keys.
 voidpublish(Object source, Map attrs)
     Injects an application event for matching.
 voidpublish(ApplicationEvent event)
     Injects an application event for matching.
 voidremoveApplicationEventListener(ApplicationEventListener listener)
     Removes an application event listener.
 ApplicationEventSubscriptionsubscribe(String eventType, Object[] eventKeys, String predicate, Date effective, Date expiry, int count, String[] correlationKeys, WorkflowContext ctx)
     Subscribes to an application event.
 TemporalEventSubscriptionsubscribe(String eventType, Date effective, String[] correlationKeys)
     Subscribes to a single timed event.
 TemporalEventSubscriptionsubscribe(String eventType, Date effective, Date expiry, int count, Duration interval, String calendar, boolean recoverable, String[] correlationKeys)
     Subscribes to a series of timed events.
 booleansupportsKeyBasedSubscriptions()
     Whether this event broker implementation supports key-based subscriptions.
 voidunsubscribe(String[] correlationKeys, boolean exact)
     Cancels matching subscriptions.
 voidupdateEventType(EventTypeMetaData eventType)
     Updates an application event type.

Field Detail
SERVICE_NAME
String SERVICE_NAME(Code)





Method Detail
addApplicationEventListener
void addApplicationEventListener(ApplicationEventListener listener)(Code)
Adds an application event listener. The event listener will be notified of all events for which a matching subscription has been registered.
Parameters:
  listener - The listener.
See Also:   ApplicationEventBroker.subscribe
See Also:   ApplicationEventBroker.removeApplicationEventListener



createEventType
void createEventType(EventTypeMetaData eventType) throws RepositoryException(Code)
Registers an application event type.
Parameters:
  eventType - The application event type definition.
throws:
  ObjectAlreadyExistsException - if the event type is alreadyregistered.
throws:
  RepositoryException - if the application event type could not beregistered for some other reason.



deleteEventType
void deleteEventType(String eventType) throws RepositoryException(Code)
Unregisters an application event type.
Parameters:
  eventType - The application event name.
throws:
  ObjectNotFoundException - if the application event name is notregistered.
throws:
  RepositoryException - if the application event type could not beunregistered for some other reason.



findEventTypeMetaData
EventTypeMetaData[] findEventTypeMetaData() throws RepositoryException(Code)
Finds meta-data for all application event types. This method is intended to support design-time clients and management applications. The list of all application event types.
throws:
  RepositoryException - if an error occurred.



findEventTypeMetaData
EventTypeMetaData findEventTypeMetaData(String eventId) throws RepositoryException(Code)
Finds meta-data for a specific application event type.
Parameters:
  eventId - The application event ID. Meta-data for the event type.
throws:
  RepositoryException -



fireApplicationEvent
void fireApplicationEvent(ApplicationEvent event, String[] correlationKeys)(Code)
Notifies listeners of an event which matches the specified correlation keys. This method is present solely to support custom event broker implementations. It should not be called by client code.
Parameters:
  event - The matching event.
Parameters:
  correlationKeys - The correlation keys from the matchedsubscription.
See Also:   AsyncFireApplicationEvent



publish
void publish(Object source, Map attrs) throws RepositoryException, EvaluatorException(Code)
Injects an application event for matching. This overload of the publish method provides a loosely coupled integration mechanism that imposes minimal requirements on the source application.

Matching subscriptions which do not specify an expiry date are cancelled when they have been fulfilled.

If contentType is not specified, the method infers it from the event data by calling @link #process(Object). Similarly, if schema is not specified, the method infers it from the event data. For a contentType of text/xml, the schema is of the form {<namespace>}<tag-name>, where <namespace> is either the PublicId or SystemId of a DTD if specified, or the namespace URI of the document element. If no <namespace> is present, the schema is simply <tag-name>. For a contentType of application/x-java-object, the schema is the fully qualified Java class name.
Parameters:
  source - The source object which raised the event.
Parameters:
  attrs - Additional metadata about the event data.
See Also:   ApplicationEventBroker.publish(ApplicationEvent)




publish
void publish(ApplicationEvent event) throws RepositoryException, EvaluatorException(Code)
Injects an application event for matching. This overload of the publish method provides a tightly coupled integration mechanism that imposes certain requirements on the source application.

Matching subscriptions which do not specify an expiry date are cancelled when they have been fulfilled.
Parameters:
  event - The application event.
See Also:   ApplicationEventBroker.publish(Object,Map)




removeApplicationEventListener
void removeApplicationEventListener(ApplicationEventListener listener)(Code)
Removes an application event listener. The event listener will no longer be notified of events, matching or otherwise.
Parameters:
  listener - The listener.
See Also:   ApplicationEventBroker.addApplicationEventListener



subscribe
ApplicationEventSubscription subscribe(String eventType, Object[] eventKeys, String predicate, Date effective, Date expiry, int count, String[] correlationKeys, WorkflowContext ctx) throws RepositoryException(Code)
Subscribes to an application event. The event broker uses the specified event type, keys and predicate to match a particular event occurrence to the subscription.

The matching events and the correlation keys from the subscription are delivered to the external event listener that was registered in a prior call to addApplicationEventListener.
Parameters:
  eventType - The name of the event type. Must be registered with theevent broker.
Parameters:
  eventKeys - The keys required to identify the particular eventoccurrence of interest. The keys act as a coarse grained filter that canbe efficiently compared with the corresponding keys on an inbound event.Can be null, but beware the potential performance impact ifpredicate is not null, because the event brokerwould have to evaluate all such conditions for every occurrence ofeventType.
Parameters:
  predicate - An additional qualifying condition required to identifythe particular event occurrence of interest. The predicate is evaluatedagainst the inbound ApplicationEvent.
Parameters:
  effective - The date/time at which the subscription becomeseffective. Can be null, in which case the subscriptionbecomes effective immediately.
Parameters:
  expiry - The date/time at which the subscription expires. Can benull, in which case the subscription never expires.
Parameters:
  count - The number of such events to deliver. The subscriptionautomatically expires when the countth event has beendelivered or when expiry elapses, whichever occurs sooner.Constraint: count == -1 || count >= 1.
Parameters:
  correlationKeys - Contextual information that will be passed to theevent listener when the event occurs. Typically contains unique keysfor various workflow entities.
Parameters:
  ctx - Workflow execution context. The event subscription.
throws:
  RepositoryException - if the subscription could not be created.
See Also:   ApplicationEventBroker.addApplicationEventListener
See Also:   ApplicationEventBroker.unsubscribe




subscribe
TemporalEventSubscription subscribe(String eventType, Date effective, String[] correlationKeys) throws RepositoryException(Code)
Subscribes to a single timed event. The event broker schedules the delivery of an event of the specified type using the correlation keys supplied. Such subscriptions are always recoverable.

The matching event and the correlation keys from the subscription is delivered to the external event listener that was registered in a prior call to addApplicationEventListener.
Parameters:
  eventType - The name of the event type.
Parameters:
  effective - The date/time at which to deliver the event.
Parameters:
  correlationKeys - Contextual information that will be passed to theevent listener when the event occurs. Typically contains unique keysfor various workflow entities. The event subscription.
throws:
  RepositoryException - if the subscription could not be created.
See Also:   ApplicationEventBroker.subscribe(String,Date,Date,int,Duration,String,boolean,String[])
See Also:   ApplicationEventBroker.unsubscribe
See Also:   ApplicationEventBroker.addApplicationEventListener




subscribe
TemporalEventSubscription subscribe(String eventType, Date effective, Date expiry, int count, Duration interval, String calendar, boolean recoverable, String[] correlationKeys) throws RepositoryException(Code)
Subscribes to a series of timed events. The event broker schedules the delivery of a series of up to count events of the specified eventType. The subscription expires when that number of events has been delivered or at the specified expiry date, whichever is sooner. The delivery time for the next event in the series is computed against the specified calendar by adding interval to the previous effective date.

The matching events and the correlation keys from the subscription are delivered to the external event listener that was registered in a prior call to addApplicationEventListener.
Parameters:
  eventType - The name of the event type.
Parameters:
  effective - The date/time at which to deliver the first event.
Parameters:
  expiry - The date/time at which the subscription expires. Can benull.
Parameters:
  count - The number of such events to deliver. The subscriptionautomatically expires when the countth event has beendelivered or when expiry elapses, whichever occurs sooner.Constraint: count == -1 || count >= 1.
Parameters:
  interval - The interval between events in the series.
Parameters:
  calendar - The name of theBusinessCalendar BusinessCalendar to use whenperforming temporal computations. Can be null.
Parameters:
  recoverable - true if the temporal events arerecoverable (i.e., must still be processed even if they occurred whilethe server was down).
Parameters:
  correlationKeys - Contextual information that will be passed to theevent listener when the event occurs. Typically contains unique keysfor various workflow entities. The event subscription.
throws:
  RepositoryException - if the subscription could not be created.
See Also:   ApplicationEventBroker.subscribe(String,Date,String[])
See Also:   ApplicationEventBroker.unsubscribe
See Also:   ApplicationEventBroker.addApplicationEventListener




supportsKeyBasedSubscriptions
boolean supportsKeyBasedSubscriptions()(Code)
Whether this event broker implementation supports key-based subscriptions. true if it does.



unsubscribe
void unsubscribe(String[] correlationKeys, boolean exact) throws RepositoryException(Code)
Cancels matching subscriptions. The subscriptions must have been established by a prior call to ApplicationEventBroker.subscribe .
Parameters:
  correlationKeys - Keys identifying the subscriptions to cancel.
Parameters:
  exact - true to cancel only those subscriptions whosecorrelationKeys match exactly in number and value. falsepermits all subscriptions within a particular scope to be cancelled. Forexample, {x,y} would match {x,y}, {x,y,z1} ... {x,y,zN} etc. inexactly, but would only match {x,y} exactly.
throws:
  RepositoryException - if the subscriptions could not be removed.
See Also:   ApplicationEventBroker.subscribe(String,Object[],String,Date,Date,int,String[],WorkflowContext)
See Also:   ApplicationEventBroker.subscribe(String,Date,String[])
See Also:   ApplicationEventBroker.subscribe(String,Date,Date,int,Duration,String,boolean,String[])



updateEventType
void updateEventType(EventTypeMetaData eventType) throws RepositoryException(Code)
Updates an application event type.
Parameters:
  eventType - The application event type definition.
throws:
  ObjectNotFoundException - if the application event name is notregistered.
throws:
  RepositoryException - if the application event type could not beupdated for some other reason.



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