BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

weblogic.event.common
Interface EventServicesDef


public interface EventServicesDef

Interface that defines an event service factory. Use this interface to manufacture objects for WebLogic Events. The event service factory methods take the place of constructors for objects that are used by WebLogic Events.

Here's an example of how this interface is used in the process of registering interest in an event:

   // Create a T3Client
   T3Client t3 = new T3Client("t3://host:port");

   // Manufacture an EventRegistration object for the client
   EventRegistrationDef er = t3.services.events()
               .getEventRegistration(
                     "STOCKS",
                     new Evaluate("examples.event.stocks.EvaluateStocks",
                                  evRegParams),
                     new Action ("examples.event.stocks.MailStockInfo",
                                  acRegParams));

   // Do the registration with methods from the object's class
   int regid = er.register();

Author:
Copyright (c) 1996-1998 by WebLogic, Inc., Copyright (c) 1998-1999 by BEA Systems, Inc. All Rights Reserved.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:
T3ServicesDef, EventRegistrationDef, EventMessageDef

Method Summary
 EventMessageDef getEventMessage(java.lang.String topic, java.lang.Object params)
          Gets a new EventMessage object from the event services factory with the specified topic and ParamSet.
 EventMessageDef getEventMessage(java.lang.String topic, ParamSet params)
          Gets a new EventMessage object from the event services factory with the specified topic and ParamSet.
 EventRegistrationDef getEventRegistration(java.lang.String topic, Evaluate evaluate, Action action)
          Gets a new EventRegistration object from the event services factory with the specified topic, Evaluate, and Action classes.
 EventRegistrationDef getEventRegistration(java.lang.String topic, Evaluate evaluator, Action action, boolean ownThread, boolean sink, boolean phase, int count)
          Deprecated. ownThread parameter no longer supported
 EventRegistrationDef getEventRegistration(java.lang.String topic, Evaluate evaluator, Action action, boolean sink, boolean phase, int count)
          Gets a new EventRegistration object from the event services factory with the specified topic, Evaluate, and Action classes.
 EventTopicDef getEventTopic(java.lang.String topic)
          Gets a representation of an Event Topic in the Topic tree.
 EventTopicDef getEventTopic(java.lang.String topic, int lifetime)
          Gets a representation of an Event Topic in the Topic tree, according to the specified lifetime.
 boolean unregister(int regID)
          Unregisters the EventRegistration corresponding to the registration ID.
 

Method Detail

getEventMessage

public EventMessageDef getEventMessage(java.lang.String topic,
                                       java.lang.Object params)
Gets a new EventMessage object from the event services factory with the specified topic and ParamSet. An event producer uses an EventMessage to submit an event to the WebLogic Server.

Parameters:
topic - Topic of the EventMessage
params - Event message body
Returns:
EventMessage

getEventMessage

public EventMessageDef getEventMessage(java.lang.String topic,
                                       ParamSet params)
Gets a new EventMessage object from the event services factory with the specified topic and ParamSet. An event producer uses an EventMessage to submit an event to the WebLogic Server.

Parameters:
topic - Topic of the EventMessage
params - Event message ParamSet
Returns:
EventMessage

getEventRegistration

public EventRegistrationDef getEventRegistration(java.lang.String topic,
                                                 Evaluate evaluate,
                                                 Action action)
                                          throws EventRegistrationException
Gets a new EventRegistration object from the event services factory with the specified topic, Evaluate, and Action classes. An event consumer registers interest in an event by submitting an EventRegistration to the WebLogic Server. Defaults set with this method for the EventRegistration are sink=true, phase=true, and count=EventRegistrationDef.UNCOUNTED.

Parameters:
topic - Topic in which to register an interest
evaluate - Evaluate object for the registration
action - Action object for the registration
Returns:
EventRegistration
Throws:
EventRegistrationException - if the event registration cannot be created

getEventRegistration

public EventRegistrationDef getEventRegistration(java.lang.String topic,
                                                 Evaluate evaluator,
                                                 Action action,
                                                 boolean sink,
                                                 boolean phase,
                                                 int count)
                                          throws EventRegistrationException
Gets a new EventRegistration object from the event services factory with the specified topic, Evaluate, and Action classes. An event consumer registers interest in an event by submitting an EventRegistration to the WebLogic Server.

The polarity of the phase argument matches the return of the evaluate() method for an EventRegistration. For example, if the topic is "fogginess" and the registration is interested in a lack of fogginess, the phase should be set to false

Parameters:
topic - Topic in which to register an interest
evaluate - An Evaluate object that implements weblogic.event.evaluators.EvaluateDef interface
action - An Action object that implements weblogic.event.actions.ActionDef interface
sink - true if the registration should receive notification of every event in which it has registered interest, as well as notification of events in any more specific topics
phase - true if this registration is interested in the "true" state of the evaluation
count - Specifies the number of events that this registration should receive before automatically unregistering itself; specify weblogic.event.common.EventRegistrationDef.UNCOUNTED for an unlimited registration
Returns:
EventRegistration
Throws:
EventRegistrationException - if the event registration cannot be created

getEventRegistration

public EventRegistrationDef getEventRegistration(java.lang.String topic,
                                                 Evaluate evaluator,
                                                 Action action,
                                                 boolean ownThread,
                                                 boolean sink,
                                                 boolean phase,
                                                 int count)
                                          throws EventRegistrationException
Deprecated. ownThread parameter no longer supported
Gets a new EventRegistration object from the event services factory. Deprecated with release 2.5. ownThread is no longer supported. Use getEventRegistration(topic,evaluator,action,sink,phase,count) instead.

Throws:
EventRegistrationException - if the registration cannot be created

getEventTopic

public EventTopicDef getEventTopic(java.lang.String topic,
                                   int lifetime)
                            throws T3Exception
Gets a representation of an Event Topic in the Topic tree, according to the specified lifetime. EventTopicDef.EPHEMERAL will cause the topic to disappear after the last deregistration. If EventTopicDef.DURABLE, the topic will remain in the tree even when there are no registrations.

Parameters:
topic - String representation of Topic
lifetime - Specifies how long this topic will remain in the topic tree
Returns:
EventTopic
Throws:
T3Exception - if the topic cannot be gotten

getEventTopic

public EventTopicDef getEventTopic(java.lang.String topic)
                            throws T3Exception
Gets a representation of an Event Topic in the Topic tree. By default the topic is ephemeral, meaning that the topic will be removed from the topic tree providing there are no subtopics or ACLs associated with it.

Parameters:
topic - String representation of Topic
Returns:
EventTopic
Throws:
T3Exception - if the event topic cannot be retrieved

unregister

public boolean unregister(int regID)
                   throws EventRegistrationException
Unregisters the EventRegistration corresponding to the registration ID.

Parameters:
regID - Registration ID
Returns:
false if the registration id is not valid
Throws:
EventRegistrationException - if there is an error unregistering registration

Documentation is available at
http://www.weblogic.com/docs51