Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Event Processing for Oracle Java Embedded
11g Release 1 (11.1.1.7)

E39906-01
FRAMES    NO FRAMES
DETAIL:  FIELD | CONSTR | METHOD


com.bea.wlevs.ede.api
Interface FaultHandler


public interface FaultHandler

Service for providing custom fault handlers.

When processing events in the context of Java code, such as it is the case for custom adapters event beans, and general beans, a developer can always make use of Java's exception handling mechanism (i.e. try-catch) to treat event processing errors. However, there are cases when it is not possible to do so. For example, this is the case if the error occurs within a processor's query (e.g. CQL), or if the error occurs in a channel's background thread. Fault handlers allow a developer to provide Java code for handling these situations where normally the developer cannot use Java's try-catch for handling errors that occur during the event processing flow.

The fault handler service must be registered in the OSGi service registry using the following service properties: application.identity, stage.identity. These properties identify where the handler is attached. For example, use the following declarative code to associate a fault handler to a processor called 'proc' in the EPN of an application called 'helloworld':

   <osgi:service interface="com.bea.wlevs.ede.api.FaultHandler">
    <osgi:service-properties>
      <entry key="application.identity" value="helloworld"/>
      <entry key="stage.identity" value="proc"/>
    </osgi:service-properties>
    <bean class="mypackage.MyFaultHandler"/>
  </osgi:service>
 
See Also:
EventProcessingException

Field Summary
static java.lang.String APP_ID
          Use this mandatory service property to specify target application.
static java.lang.String STAGE_ID
          Use this mandatory service property to specify target stage.

 

Method Summary
 void handleFault(java.lang.Throwable fault, java.lang.String[] catchers)
          This method is called-back informing handler of a fault that happened while processing an event, or a batch of events, allowing client to provide custom handling of faults.

 

Field Detail

APP_ID

public static final java.lang.String APP_ID
Use this mandatory service property to specify target application.

STAGE_ID

public static final java.lang.String STAGE_ID
Use this mandatory service property to specify target stage.

Method Detail

handleFault

public void handleFault(java.lang.Throwable fault,
                        java.lang.String[] catchers)
                 throws java.lang.Throwable
This method is called-back informing handler of a fault that happened while processing an event, or a batch of events, allowing client to provide custom handling of faults.

Handler may consume fault, or re-throw fault, or throw a new exception. If fault is not consumed, then upstream event sources (catchers) would receive it.

The parameter catchers specifies potential upstream event sources that receives the fault in case it is not handled. In case of a concurrent channel or a heart-beat CQL thread, there are no upstream sources and so this is an empty array.

If no fault handlers exist for a particular stage (node) in the EPN, then a default one is used. If a custom fault handler is provided, then the default one is NOT used. Most default fault handlers just re-throw fault. However, the default behavior for a CQL processor fault handler is to stop a running CQL query where fault was emitted.

Fault may be an EventProcessingException, or even a JVM Error.
Parameters:
fault - EventProcessingException or JVM error
catchers - Name of upstream event sources that potentially may receive fault if not handled.
Throws:
java.lang.Throwable - re-throw or not handled fault

Overview  Package   Class   Use  Tree  Deprecated  Index  Help 
Copyright © 2007, 2013 Oracle and/or its affiliates. All rights reserved.
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD