Java Doc for EventNotifier.java in  » ESB » open-esb » com » sun » jbi » framework » 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 » ESB » open esb » com.sun.jbi.framework 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.management.NotificationBroadcasterSupport
      com.sun.jbi.framework.EventNotifier

EventNotifier
public class EventNotifier extends NotificationBroadcasterSupport implements EventNotifierCommon,EventNotifierMBean(Code)
This is the instance Event Notifier MBean that generates notifications for the entire JBI runtime. There is one of these MBeans per runtime instance, and it is called to emit notifications for all applicable events in the runtime. This MBean is registered with ServiceName=Framework, ControlType=Notification, and ComponentType=System. Notifications that are currently supported by this implementation include:
  • JBI Runtime:
    • Ready
    • Started
    • Stopped
  • Component (Binding Component / Service Engine):
    • Installed
    • Started
    • Stopped
    • Shut down
    • Uninstalled
  • Shared Library:
    • Installed
    • Uninstalled
  • Service Assembly:
    • Deployed
    • Started
    • Stopped
    • Shut down
    • Undeployed
  • Service Unit:
    • Deployed
    • Started
    • Stopped
    • Shut down
    • Undeployed
All notifications emitted by this MBean are instances of the javax.management.Notification class, and include following information:
  • type - a dotted string describing the notification, such as "com.sun.jbi.started.binding.component"
  • msg - a message resulting from the operation, such as "Binding sun-http-binding started successfully"
  • seqNo - a sequence number which is unique for the current execution of the runtime
  • timeStamp - a timestamp indicating the time the notification was created
  • userData - a javax.management.openmbean.CompositeData object which contains the following:
    • Event type: Deployed, Undeployed, Installed, Uninstalled, Started, Stopped, or ShutDown
    • Source type: BindingComponent, ServiceEngine, SharedLibrary, ServiceAssembly, ServiceUnit, or JBIRuntime
    • Source name: component name, shared library name, service assembly name, or service unit name
    • Target name: instance name or cluster name + instance name, such as "server", "instance1", or "cluster1-instance1"
    • Component name: this is present only for Service Unit notifications
    • Service Assembly name: this is present only for Service Unit notifications
Note that this class extends the NotificationBroadcasterSupport class provided by the JDK, and there is no guarantee that the calls to send notifications are asynchronous. Therefore, all sending of notifications is done on separate threads to ensure that an ill-behaved client cannot block the thread on which the call to this class was made. This is done using the facilities provided by the java.util.concurrent package. In the constructor for this class, a thread pool is created, and all calls to the sendNotification() method are made using this thread pool. The Notify class contained in this class implements the Runnable interface and is used to make the sendNotification() calls.
author:
   Mark S White

Inner Class :class Notify implements Runnable

Field Summary
final static  StringCOMPONENT_NAME_KEY
     Item name key for component name.
final static  StringEVENT_TYPE_KEY
    
final static  String[]ITEM_DESCRIPTIONS_1
     List of descriptions of items for CompositeData construction for runtime, component, shared library, and service assembly notifications.
final static  String[]ITEM_DESCRIPTIONS_2
     List of descriptions of items for CompositeData construction for service unit notifications.
final static  String[]ITEM_NAMES_1
     List of item names for CompositeData construction for runtime, component, shared library, and service assembly notifications.
final static  String[]ITEM_NAMES_2
     List of item names for CompositeData construction for service unit notifications.
final static  OpenType[]ITEM_TYPES_1
     List of types of items for CompositeData construction for runtime, component, shared library, and service assembly notifications.
final static  OpenType[]ITEM_TYPES_2
     List of types of items for CompositeData construction for service unit notifications.
final static  StringJBI_FRAMEWORK
     Source name for JBI runtime notification messages.
final static  StringSERVICE_ASSEMBLY_NAME_KEY
     Item name key for service assembly name.
final static  StringSERVICE_UNIT_NAME_KEY
     Item name key for service unit name.
final static  StringSOURCE_NAME_KEY
     Item name key for source type.
final static  StringSOURCE_TYPE_KEY
     Item name key for source type.
final static  StringTARGET_NAME_KEY
     Item name key for target name.

Constructor Summary
 EventNotifier(EnvironmentContext ctx)
     Constructor to set up local constants.

Method Summary
public  voiddisableNotifications()
     Disable event notifications from being emitted by this MBean.
public  NotificationemitComponentNotification(EventType eventType, SourceType sourceType, String componentName, String msg)
     Emit a notification for an event on either a binding component or a service engine.
public  NotificationemitRuntimeNotification(EventType eventType, String msg)
     Emit a notification for an event on the JBI runtime.
public  NotificationemitServiceAssemblyNotification(EventType eventType, String serviceAssemblyName, String msg)
     Emit a notification for an event on a service assembly.
public  NotificationemitServiceUnitNotification(EventType eventType, String serviceUnitName, String serviceAssemblyName, String componentName, String msg)
     Emit a notification for an event on a service unit.
public  NotificationemitSharedLibraryNotification(EventType eventType, String sharedLibraryName, String msg)
     Emit a notification for an event on a shared library.
public  voidenableNotifications()
     Enable event notifications to be emitted by this MBean.
public  MBeanNotificationInfo[]getNotificationInfo()
     Returns an array indicating, for each notification this MBean may send, the notification type, the name of the Java class of the notification, and a description of the notification.
 voidinstanceStarting()
     Inform the DAS Event Notifier MBean that this instance is starting.
 voidinstanceStopping()
     Inform the DAS Event Notifier MBean that this instance is stopping.

Field Detail
COMPONENT_NAME_KEY
final static String COMPONENT_NAME_KEY(Code)
Item name key for component name. Package-visible for unit testing.



EVENT_TYPE_KEY
final static String EVENT_TYPE_KEY(Code)



ITEM_DESCRIPTIONS_1
final static String[] ITEM_DESCRIPTIONS_1(Code)
List of descriptions of items for CompositeData construction for runtime, component, shared library, and service assembly notifications. Package-visible for unit testing.



ITEM_DESCRIPTIONS_2
final static String[] ITEM_DESCRIPTIONS_2(Code)
List of descriptions of items for CompositeData construction for service unit notifications. Package-visible for unit testing.



ITEM_NAMES_1
final static String[] ITEM_NAMES_1(Code)
List of item names for CompositeData construction for runtime, component, shared library, and service assembly notifications. Package-visible for unit testing.



ITEM_NAMES_2
final static String[] ITEM_NAMES_2(Code)
List of item names for CompositeData construction for service unit notifications. Package-visible for unit testing.



ITEM_TYPES_1
final static OpenType[] ITEM_TYPES_1(Code)
List of types of items for CompositeData construction for runtime, component, shared library, and service assembly notifications. Package- visible for unit testing.



ITEM_TYPES_2
final static OpenType[] ITEM_TYPES_2(Code)
List of types of items for CompositeData construction for service unit notifications. Package-visible for unit testing.



JBI_FRAMEWORK
final static String JBI_FRAMEWORK(Code)
Source name for JBI runtime notification messages. Package-visible for unit testing.



SERVICE_ASSEMBLY_NAME_KEY
final static String SERVICE_ASSEMBLY_NAME_KEY(Code)
Item name key for service assembly name. Package-visible for unit testing.



SERVICE_UNIT_NAME_KEY
final static String SERVICE_UNIT_NAME_KEY(Code)
Item name key for service unit name. Package-visible for unit testing.



SOURCE_NAME_KEY
final static String SOURCE_NAME_KEY(Code)
Item name key for source type. Package-visible for unit testing.



SOURCE_TYPE_KEY
final static String SOURCE_TYPE_KEY(Code)
Item name key for source type. Package-visible for unit testing.



TARGET_NAME_KEY
final static String TARGET_NAME_KEY(Code)
Item name key for target name. Package-visible for unit testing.




Constructor Detail
EventNotifier
EventNotifier(EnvironmentContext ctx) throws javax.jbi.JBIException(Code)
Constructor to set up local constants.
Parameters:
  ctx - the environment context for the JBI runtime.




Method Detail
disableNotifications
public void disableNotifications()(Code)
Disable event notifications from being emitted by this MBean.



emitComponentNotification
public Notification emitComponentNotification(EventType eventType, SourceType sourceType, String componentName, String msg)(Code)
Emit a notification for an event on either a binding component or a service engine. The caller provides information that determines the content of the notification. The event type for a component notification can be Installed, Uninstalled, Started, Stopped, or ShutDown. The source type is either BindingComponent or ServiceEngine.
Parameters:
  eventType - the type of event that occurred.
Parameters:
  sourceType - the type of component on which the event occurred.
Parameters:
  componentName - the name of the component on which the eventoccurred.
Parameters:
  msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting).



emitRuntimeNotification
public Notification emitRuntimeNotification(EventType eventType, String msg)(Code)
Emit a notification for an event on the JBI runtime. The caller provides information that determines the content of of the notification. The event type for a JBI runtime notification can be Ready, Started, or Stopped. The source type is always JBIRuntime.
Parameters:
  eventType - the type of event that occurred.
Parameters:
  msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting).



emitServiceAssemblyNotification
public Notification emitServiceAssemblyNotification(EventType eventType, String serviceAssemblyName, String msg)(Code)
Emit a notification for an event on a service assembly. The caller provides information that determines the content of the notification. The event type for a service assembly notification can be Deployed, Undeployed, Started, Stopped, or ShutDown. The source type is always ServiceAssembly.
Parameters:
  eventType - the type of event that occurred.
Parameters:
  serviceAssemblyName - the name of the service assembly on which theevent occurred.
Parameters:
  msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting).



emitServiceUnitNotification
public Notification emitServiceUnitNotification(EventType eventType, String serviceUnitName, String serviceAssemblyName, String componentName, String msg)(Code)
Emit a notification for an event on a service unit. The caller provides information that determines the content of the notification. The event type for a service unit notification can be Deployed, Undeployed, Started, Stopped, or ShutDown. The source type is always ServiceUnit.
Parameters:
  eventType - the type of event that occurred.
Parameters:
  serviceUnitName - the name of the service unit on which the eventoccurred.
Parameters:
  serviceAssemblyName - the name of the service assembly to which theservice unit belongs.
Parameters:
  componentName - the name of the component to which the service unitis deployed.
Parameters:
  msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting).



emitSharedLibraryNotification
public Notification emitSharedLibraryNotification(EventType eventType, String sharedLibraryName, String msg)(Code)
Emit a notification for an event on a shared library. The caller provides information that determines the content of the notification. The event type for a shared library notification can be either Installed or Uninstalled. The source type is always SharedLibrary.
Parameters:
  eventType - the type of event that occurred.
Parameters:
  sharedLibraryName - the name of the shared library on which theevent occurred.
Parameters:
  msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting).



enableNotifications
public void enableNotifications()(Code)
Enable event notifications to be emitted by this MBean.



getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()(Code)
Returns an array indicating, for each notification this MBean may send, the notification type, the name of the Java class of the notification, and a description of the notification. an array of javax.managagement.MBeanNotificationInfoobjects which describe the notifications.



instanceStarting
void instanceStarting()(Code)
Inform the DAS Event Notifier MBean that this instance is starting. This causes the DAS MBean to invoke the addNotificationListener() operation on this instance MBean to register itself as a notification listener for notifications from this instance. This method is called by the framework during startup.



instanceStopping
void instanceStopping()(Code)
Inform the DAS Event Notifier MBean that this instance is stopping. This causes the DAS MBean to invoke the removeNotificationListener operation on this instance MBean to unregister itself as a notification listener for notifications from this instance. This method is called by the framework during shutdown.



Methods inherited from javax.management.NotificationBroadcasterSupport
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)(Code)(Java Doc)
public MBeanNotificationInfo[] getNotificationInfo()(Code)(Java Doc)
protected void handleNotification(NotificationListener listener, Notification notif, Object handback)(Code)(Java Doc)
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException(Code)(Java Doc)
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException(Code)(Java Doc)
public void sendNotification(Notification notification)(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.