Skip navigation links

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.2.1)

Part Number E55141-01
P4 Change 1723563 on 2015/10/09


weblogic.cluster.migration
Interface Migratable


public interface Migratable

Every migratable service must implement the Migratable interface. This interface defines the methods that the migration framework will call to carry out migration. When a migratable service is deployed, an instance of the service class that implements this interface is installed on every potential host and registered with the local MigrationManager. The Migratable interface defines the methods used to manage the lifecycle of each instance.

When the instance is first deployed, the framework will call the migratableInitialize() method. When this method returns, the instance is initialized but inactive. Once an instance of the service has been deployed on each potential host, the framework chooses one instance to activate and calls the Migratable.migratableActivate() on that instance. When this call returns that instance of the service is active and all others are inactive. When it is time to migrate an instance, the framework first calls Migratable.migratableDeactivate() on the active instance. It then calls Migratable.migratableActivate() on the new instance. When the second call returns, migration is complete.

UNINITIALIZED | | initialize | deactivate V +------------->INACTIVE<----------+ | | | PREPARING_TO_DEACTIVATE | activate |deactivate ^ | | | V | +---------------ACTIVE------------+

An implementation must meet special requirements in order to function properly as a migratable service. Namely, it must guarantee that no service method called before the end of a lease will return after the lease has expired. This can be accomplished in one of two ways:


Field Summary
static int ACTIVATING
           
static int ACTIVE
           
static int DEFAULT_ORDER
           
static int EARLY_ORDER
           
static int FILESTORE_ORDER
           
static int INACTIVE
           
static int LATE_ORDER
           
static int MDB_ORDER
           

 

Method Summary
abstract  String getName()
           
abstract  int getOrder()
          Returns the order value for this particular migratable object.
abstract  void migratableActivate()
          Called to activate this instance of the migratable service.
abstract  void migratableDeactivate()
          Called to deactivate this instance of the migratable service.
abstract  void migratableInitialize()
          Called to initialize this instance of the migratable service.

 

Field Detail

INACTIVE

static final int INACTIVE
See Also:
Constant Field Values

ACTIVE

static final int ACTIVE
See Also:
Constant Field Values

ACTIVATING

static final int ACTIVATING
See Also:
Constant Field Values

DEFAULT_ORDER

static final int DEFAULT_ORDER
See Also:
Constant Field Values

EARLY_ORDER

static final int EARLY_ORDER
See Also:
Constant Field Values

FILESTORE_ORDER

static final int FILESTORE_ORDER
See Also:
Constant Field Values

LATE_ORDER

static final int LATE_ORDER
See Also:
Constant Field Values

MDB_ORDER

static final int MDB_ORDER
See Also:
Constant Field Values

Method Detail

getName

String getName()

migratableInitialize

void migratableInitialize()
                          throws MigrationException
Called to initialize this instance of the migratable service. The cluster calls this method when this instance is registered with the local MigrationManagerService. When this call completes, the instance is considered initialized but inactive.
Throws:
MigrationException

migratableActivate

void migratableActivate()
                        throws MigrationException
Called to activate this instance of the migratable service. The cluster ensures that only one instance is active at a time. This instance should respond by preparing to service requests. This will typically involve recovering the service state from persistent storage.
Throws:
MigrationException

migratableDeactivate

void migratableDeactivate()
                          throws MigrationException
Called to deactivate this instance of the migratable service. This method is only called if the migration source server is healthy. In order to ensure that there is never more than one active instance, the cluster will call deactivate on the currently active instance before calling activate on another instance. The instance should release any claimed resources that may be required by the new instance. It may also take this opportunity to persist additional state to improve migration.

A migratable can not depend on this method being called. It is only called in the case where the migration source is still healthy. For this reason, the migratable instance must be prepared for failure at all times. This method just provides this instance an opportunity to provide a more graceful migration when conditions permit.

Throws:
MigrationException

getOrder

int getOrder()
Returns the order value for this particular migratable object. This controls in which order this object will be activated and deactivated with regards to all the other migratable objects deployed on a migratable target.

Skip navigation links

Copyright 1996, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.2.1)

Part Number E55141-01
P4 Change 1723563 on 2015/10/09