Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Server Wireless J2ME SDK API Reference B14045-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.wireless.me.drm
Class DRMAgent

    java.lang.Object
      oracle.wireless.me.drm.DRMAgent

public abstract class DRMAgent
extends java.lang.Object

Implementation of `DRMAgent` receives notification of lifecycle methods of a context `MIDlet`. The context MIDlet is also referred to as subject MIDlet here. The implementation class will be registered automatically with the `MIDlet` at the time of application provisioning or delivery. It is guaranteed that its `onStartApp()`, `onPauseApp()` and `onDestroyApp(boolean)` methods will be called before peer methods (`startApp()`, `pauseApp()` and `destroyApp(boolean)` respectively) of the context `MIDlet` are execuated. Thus, `DRMAgent` may check the execution of subject MIDlet's lifecycle. It is anticipated that the implementation of `onStartApp()` will be the principal mechanism for checking subject MIDlet, while `onPauseApp()` and `onDestroyApp(boolean)` should be used for book-keeping chores. Depending on implementation business rules, `onStartApp()` may either execute headless or display UI widgets. Semantics of `javax.microedition.midlet.MIDlet.startApp()` method also applies to `DRMAgent.onStartApp()` for displaying UI widgets. The implemenation of `DRMAgent` can use context midlet to obtain the `javax.microedition.lcdui.Display` using following code snippet.

     Display d = Display.getDisplay(context);
     d.setCurrent(....);

It is noteworthy that completion of `DRMAgent.onStartApp()` allows UI components to be made visible even before `startApp()` method of context MIDlet completes. In effect, `DRMAgent` implementation must call `DRMAgent.resumeStartApp()` so long the peer `MIDlet.startApp()` should resume normally. Should `DRMAgent` determines to veto the normal execution of the context `MIDlet`, it may call `MIDlet.notifyDestroy()` or may throw Exception.

A well behaved `DRMAgent` should provide a public constructor with a single argument of type `MIDlet`. The general contract of the constructor implemenation is to call super class constructor with `super(context)`. As far as reasonably practical, implementations are encouraged to use obscure resource names like RMS store and keep the implementation compact. There may only be a single `DRMAgent` implmentation per Midlet Suite. The overhead of multiple `DRMAgent` classes is not deemed pragmatic for MIDP devices. At runtime, there will be exactly one instance of `DRMAgent` per `MIDlet` in a Midlet Suite.

Version:
  1.0 10/10/2002 2:28AM

Method Summary
`java.lang.String` | `getProperty(java.lang.String name)` Returns the value of the named property.
`java.lang.String` | `getProperty(java.lang.String name, java.lang.String defaultValue)` Returns the value of the named property, if the value is not found, specified default value is returned.
`void` | `onDestroyApp(boolean unconditional)` Notifies that `destroyApp` method of peer MIDlet has been called.
`void` | `onPauseApp()` Notifies that `pauseApp` method of context MIDlet has been called.
`void` | `onStartApp()` Notifies that `startApp` method of context MIDlet has been called.
`void` | `resumeStartApp()` This policy must call `resumeStartApp()` method should `startApp()` method of context MIDlet resume normally.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getProperty

    public final java.lang.String getProperty(java.lang.String name)

  Returns the value of the named property. The behaviour of this method is not defined if the delivery of an application has not occurred.

### getProperty

    public final java.lang.String getProperty(java.lang.String name,
                                              java.lang.String defaultValue)

  Returns the value of the named property, if the value is not found, specified default value is returned. The behaviour of this method is not defined if the delivery of an application has not occurred.

### resumeStartApp

    public final void resumeStartApp()

  This policy must call `resumeStartApp()` method should `startApp()` method of context MIDlet resume normally.

### onStartApp

    public void onStartApp()

  Notifies that `startApp` method of context MIDlet has been called. Any unchecked exception will be propogated to `startApp()` method of context MIDlet. By default, this implementation of `onStartApp()` calls `resumeStartApp()` to preserve the execution continuity of the context MIDlet's `startApp()` method.

### onPauseApp

    public void onPauseApp()

  Notifies that `pauseApp` method of context MIDlet has been called. Any unchecked exception will be propogated to `pauseApp()` method of context MIDlet. This class provides no-op implementation.

### onDestroyApp

    public void onDestroyApp(boolean unconditional)

  Notifies that `destroyApp` method of peer MIDlet has been called. Any unchecked exception will be propogated to `destoyApp(boolean)` method of context MIDlet. This class provides no-op implementation.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Server Wireless J2ME SDK API Reference B14045-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Oracle Corporation. All Rights Reserved.