ApplicationViewControl Interface

Base interface for all AppView controls.

# Syntax

    public interface ApplicationViewControl extends Control

# Remarks

The methods of this interface may be invoked by any web service with an AppView control instance.

# Members

## Constructors

None.

## Methods

public void beginLocalTransaction() throws Exception

Begin a local transaction on this control. This will begin a local transaction on the underlying ApplicationView instance. All work done by this control instance between this call and a call to commitLocalTransaction() or rollbackLocalTransaction() will be committed or rolled back, respectively, as a unit.

If the underlying adapter used by the ApplicationView for this control does not support local transactions, an exception is thrown. Commit or rollback can be done within the same call, but not in the callback (that is, the response to the asynchronous call) from Application View control.

public void commitLocalTransaction() throws Exception

Commit the active local transaction for this control. All work done since the last call to beginLocalTransaction() will be committed into the EIS's permanent state.

If the underlying adapter used by the ApplicationView for this control does not support local transactions, an exception is thrown. Commit or rollback can be done within the same call, but not in the callback (that is, the response to the asynchronous call) from Application View control.

public void disableEventDelivery() throws Exception

Indicates that this control should no longer deliver event notifications. Calling this method when event delivery is not enabled has no effect.

public void enableEventDelivery() throws Exception

Indicates that this control instance should provide event notifications to its container JWS instance. The containing JWS must be conversational. Events will be delivered using the MODE_ALLOW_DUPS receive mode. Calling this method when event delivery is already enabled has no effect.

public void enableEventDelivery(String receiveMode) throws Exception

Indicates that this control instance should provide event notifications to its container JWS instance using the specified receive mode. The containing JWS must be conversational. Calling this method when event delivery is already enabled is has no effect.

receiveMode specifies the mode in which all events should be received. Must be one of the MODE_XXX fields defined below.

public String getEventReceiveMode()

Returns the receive mode specified in the latest call to enableEventDelivery() or null if event delivery is not enabled. Returned mode is one of the MODE_XXX fields defined below.

public void importJar(String jarFileName, boolean overwrite, boolean deploy, List errors, PrintWriter out, boolean quiet) throws Exception

Import a previously exported ApplicationView JAR file. This file can contain ApplicationView, ConnectionFactory, Folder, and Schema definitions.

jarFileName: Either a fully qualified path to the jar to be imported, or a resource name suitable for finding the jar on the system classpath (e.g. samples/appview/Sample1.jar). This method will interpret jarFileName first as a path, and if the file does not exist, will attempt to find it on the classpath.

overwrite: A flag indicating if the imported objects should overwrite any existing objects already in the repository.

deploy: A flag indicating if the deployable imported objects should be deployed automatically after the import.

errors: A list that, upon completion of the import, will contain any non-fatal errors that occurred. Fatal errors are reported via an Exception thrown by this method.

out: A PrintWriter instance to which all messages will be written. If null, no messages will be written.

quiet: A flag indicating whether the import should operate quietly (producing fewer messages).

An Exception is thrown if any fatal error occurs during the import.

public String importJar(String jarFileName) throws Exception

Import a previously exported ApplicationView JAR file using standard options. This method will overwrite any existing objects with the same name as those in the jar, will deploy deployable objects, and will print a summary of operations to System.out. If non-fatal errors occur, this method will print a summary of those errors to System.out.

jarFileName: Either a fully qualified path to the jar to be imported, or a resource name suitable for finding the jar on the system classpath (e.g. samples/appview/Sample1.jar). This method will interpret jarFileName first as a path, and if the file does not exist, will attempt to find it on the classpath.

Returns a string description of the import operation, including any non-fatal errors.

An Exception is thrown if any fatal error occurs during the import.

public boolean isEventDeliveryEnabled()

Returns true if event delivery is enabled, false otherwise. This is true after a call to enableEventDelivery() and before a call to disableEventDelivery().

public void rollbackLocalTransaction() throws Exception

Rollback the active local transaction for this control. All work done since the last call to beginLocalTransaction() will be discarded.

If the underlying adapter used by the ApplicationView for this control does not support local transactions, an exception is thrown. Commit or rollback can be done within the same call, but not in the callback (that is, the response to the asynchronous call) from Application View control.

## Fields

static public final String MODE_ALLOW_DUPS

Use this mode if it is acceptable to receive a given event more than once. This will generally only be possible in the event of a system shutdown or failure, and will generally not occur during normal operations. This mode is the default and will give the best performance.

static public final String MODE_ONCE_AND_ONLY_ONCE

Use this mode if it is critical to receive all events and that each event be received only once, even in the event of a system failure. This mode will yield performance somewhat lower than when using MODE_ALLOW_DUPS.

## Events

public void onEvent(Object event) throws Exception;

The onEvent event is generated whenever an application view event is received. This method is private, and should not be used by JWS clients.

event: The event object representing the event in the EIS.

public void onAsyncServiceResponse(Object asr) throws Exception;

The onAsyncServiceResponse event is generated whenever an application view async response is received. This method is private, and should not be used by JWS clients.

event: The async response object representing the response from an async service invocation.

public void onAsyncServiceError(String requestID, String errorMessage) throws Exception

The onAsyncServiceError event is generated whenever an application view async request ends in error.

requestID: The identifier returned when this request was submitted.

errorMessage: The text of the error that has occurred.

Related Topics

AppView Control: Accessing an Enterprise Application from a Web Service

Using an AppView Control