Oracle Fusion Middleware
Oracle WebLogic Server MBean Javadoc
11g Release 1 (10.3.3)

Part Number E13945-03

weblogic.management.configuration
Interface MigratableTargetMBean

All Superinterfaces:
ConfigurationMBean, TargetMBean
All Known Subinterfaces:
JTAMigratableTargetMBean

public interface MigratableTargetMBean
extends TargetMBean

A target that is suitable for services that shall be active on at most one server of a cluster at a time.

Deprecation of MBeanHome and Type-Safe Interfaces

This is a type-safe interface for a WebLogic Server MBean, which you can import into your client classes and access through weblogic.management.MBeanHome. As of 9.0, the MBeanHome interface and all type-safe interfaces for WebLogic Server MBeans are deprecated. Instead, client classes that interact with WebLogic Server MBeans should use standard JMX design patterns in which clients use the javax.management.MBeanServerConnection interface to discover MBeans, attributes, and attribute types at runtime. For more information, see "Developing Manageable Applications with JMX."

Since:
7.0.0.0
See Also:
TargetMBean, SingletonServiceBaseMBean

Field Summary
static String DEFAULT_MIGRATABLETARGET_SUFFIX
           
static String EXACTLY_ONCE
           
static String FAILURE_RECOVERY
           
static String NONE
           
 
Fields inherited from interface weblogic.management.configuration.ConfigurationMBean
DEFAULT_EMPTY_BYTE_ARRAY
 
Method Summary
 boolean addConstrainedCandidateServer(ServerMBean constrainedCandidateServer)
           
 ServerMBean[] getAllCandidateServers()
          The list of servers that are candiates to host the migratable services deployed to this migratable target.
 ClusterMBean getCluster()
          Returns the cluster this singleton service is associated with.
 ServerMBean[] getConstrainedCandidateServers()
          The (user-restricted) list of servers that can host the migratable services deployed to this migratable target.
 String getMigrationPolicy()
          Defines the type of migration policy to use for the services hosted by this migratable target.
 int getNumberOfRestartAttempts()
          Specifies how many restart attempts to make before migrating the failed service.
 String getPostScript()
          Specifies the path to the post-migration script to run after a migratable target is fully deactivated.
 String getPreScript()
          Specifies the path to the pre-migration script to run before a migratable target is actually activated.
 boolean getRestartOnFailure()
          Specifies whether or not a failed service will first be deactivated and reactivated in place, instead of being migrated.
 int getSecondsBetweenRestarts()
          Specifies how many seconds to wait in between attempts to restart the failed service.
 boolean isNonLocalPostAllowed()
          Specifies whether or not the post-deactivation script is allowed to run on a different machine.
 boolean isPostScriptFailureFatal()
          Specifies whether or not a failure during execution of the post-deactivation script is fatal to the migration.
 boolean removeConstrainedCandidateServer(ServerMBean constrainedCandidateServer)
           
 void setAllCandidateServers(ServerMBean[] servers)
           
 void setCluster(ClusterMBean cluster)
          Set the cluster this singleton service is associated with.
 void setConstrainedCandidateServers(ServerMBean[] constrainedCandidateServers)
          All constrained candiate servers must belong to the same cluster.
 void setMigrationPolicy(String migrationPolicyName)
          Sets the value of the MigrationPolicy attribute.
 void setNonLocalPostAllowed(boolean allowNonLocalPost)
          Sets the value of the NonLocalPostAllowed attribute.
 void setNumberOfRestartAttempts(int restartAttempts)
          Sets the value of the NumberOfRestartAttempts attribute.
 void setPostScript(String filePath)
          Sets the value of the PostScript attribute.
 void setPostScriptFailureFatal(boolean isFatal)
          Sets the value of the PostScriptFailureFatal attribute.
 void setPreScript(String filePath)
          Sets the value of the PreScript attribute.
 void setRestartOnFailure(boolean restartOnFailure)
          Sets the value of the RestartOnFailure attribute.
 void setSecondsBetweenRestarts(int seconds)
          Sets the value of the SecondsBetweenRestarts attribute.
 void setUserPreferredServer(ServerMBean t)
           
 
Methods inherited from interface weblogic.management.configuration.ConfigurationMBean
freezeCurrentValue, getName, getNotes, isSet, restoreDefaultValue, setComments, setDefaultedMBean, setName, setNotes, setPersistenceEnabled, unSet
 

Field Detail

DEFAULT_MIGRATABLETARGET_SUFFIX

static final String DEFAULT_MIGRATABLETARGET_SUFFIX
See Also:
Constant Field Values

NONE

static final String NONE
See Also:
Constant Field Values

EXACTLY_ONCE

static final String EXACTLY_ONCE
See Also:
Constant Field Values

FAILURE_RECOVERY

static final String FAILURE_RECOVERY
See Also:
Constant Field Values
Method Detail

getConstrainedCandidateServers

ServerMBean[] getConstrainedCandidateServers()

The (user-restricted) list of servers that can host the migratable services deployed to this migratable target. The migratable service will not be allowed to migrate to a server that is not in the returned list of servers.

For example, this feature may be used to configure two servers that have access to a dual-ported ported disk. All servers in this list must be part of the cluster that is associated with the migratable target.

Returns:
The constrainedCandidateServers value

setConstrainedCandidateServers

void setConstrainedCandidateServers(ServerMBean[] constrainedCandidateServers)
                                    throws InvalidAttributeValueException

All constrained candiate servers must belong to the same cluster.

Parameters:
constrainedCandidateServers - The new constrainedCandidateServers value
Throws:
InvalidAttributeValueException

addConstrainedCandidateServer

boolean addConstrainedCandidateServer(ServerMBean constrainedCandidateServer)
                                      throws InvalidAttributeValueException
Parameters:
constrainedCandidateServer - The feature to be added to the ConstrainedCandidateServer attribute
Returns:
Throws:
InvalidAttributeValueException

removeConstrainedCandidateServer

boolean removeConstrainedCandidateServer(ServerMBean constrainedCandidateServer)
                                         throws InvalidAttributeValueException
Parameters:
constrainedCandidateServer -
Returns:
Throws:
InvalidAttributeValueException

setUserPreferredServer

void setUserPreferredServer(ServerMBean t)
Parameters:
t - The new userPreferredServer value

getCluster

ClusterMBean getCluster()

Returns the cluster this singleton service is associated with.

Returns:
The cluster value

setCluster

void setCluster(ClusterMBean cluster)

Set the cluster this singleton service is associated with.

Parameters:
cluster - The new cluster value

getAllCandidateServers

ServerMBean[] getAllCandidateServers()

The list of servers that are candiates to host the migratable services deployed to this migratable target. If the constrainedCandidateServers list is empty, all servers in the cluster are returned. If the constrainedCandidateServers list is not empty, only those servers will be returned. The user-preferred server will be the first element in the list.

Returns:
The allCandidateServers value

setAllCandidateServers

void setAllCandidateServers(ServerMBean[] servers)
Parameters:
servers - The new allCandidateServers value

getMigrationPolicy

String getMigrationPolicy()

Defines the type of migration policy to use for the services hosted by this migratable target. Valid options are:

Returns:
MigrationPolicy, the name of the auto migration policy chosen for this target
See Also:
MigratableTargetMBean.setUserPreferredServer(weblogic.management.configuration.ServerMBean)
Default Value:
MigratableTargetMBean.NONE
Valid Values:
MigratableTargetMBean.NONE, MigratableTargetMBean.EXACTLY_ONCE, MigratableTargetMBean.FAILURE_RECOVERY

setMigrationPolicy

void setMigrationPolicy(String migrationPolicyName)
Sets the value of the MigrationPolicy attribute.

Parameters:
migrationPolicyName - the name of the auto migration policy chosen for this target
See Also:
MigratableTargetMBean.getMigrationPolicy()

getPreScript

String getPreScript()

Specifies the path to the pre-migration script to run before a migratable target is actually activated. The script must be in the MIDDLEWARE_HOME/user_projects/domains/mydomain/bin/service_migration directory.

Before the migratable target is activated, if there is a script specified, and Node Manager is available, then the script will run. Specifying a script without an available Node Manager will result in an error upon migration.

If the script fails or cannot be found, migration will not proceed on the current server, and will be tried on the next suitable server. This could be the next server in the candidate server list, or in the cluster, if there is no candidate server list.


setPreScript

void setPreScript(String filePath)
Sets the value of the PreScript attribute.

Parameters:
filePath - file name and relative path for pre script
See Also:
MigratableTargetMBean.getPreScript()

getPostScript

String getPostScript()

Specifies the path to the post-migration script to run after a migratable target is fully deactivated. The script must be in the MIDDLEWARE_HOME/user_projects/domains/mydomain/bin/service_migration directory.

After the migratable target is deactivated, if there is a script specified, and Node Manager is available, then the script will run. Specifying a script without an available Node Manager will result in an error upon migration.


setPostScript

void setPostScript(String filePath)
Sets the value of the PostScript attribute.

Parameters:
filePath - file name and relative path for post script
See Also:
MigratableTargetMBean.getPostScript()

isPostScriptFailureFatal

boolean isPostScriptFailureFatal()

Specifies whether or not a failure during execution of the post-deactivation script is fatal to the migration.

If it is fatal, the migratable target will not be automatically migrated until an administrator manually migrates it to a server, thus reactivating it.

Note: Enabling this value will result in weakening the exactly-once guarantee. It is provided to prevent more dangerous data corruption if the post-deactivation script fails. Also if this value is enabled, then the script may be called more than once by the migration framework after the Migratable Target is deactivated or the server or machine hosting the Migratable Target crashed or is network partitioned. The script is expected not to return different exit values when invoked multiple times in such scenarios.

Returns:
boolean indicating if the failure of a post-deactivation script is fatal to the migration or not
Default Value:
true

setPostScriptFailureFatal

void setPostScriptFailureFatal(boolean isFatal)
Sets the value of the PostScriptFailureFatal attribute.

Parameters:
isFatal - indicating if the failure of a post-deactiation script is fatal to the migration or not
See Also:
MigratableTargetMBean.isPostScriptFailureFatal()

isNonLocalPostAllowed

boolean isNonLocalPostAllowed()

Specifies whether or not the post-deactivation script is allowed to run on a different machine.

Normally, when auto migration occurs, the post-deactivation script will be run on the service's current location, and the pre-activation script on the service's new location. If the current location is unreachable for some reason, this value will be checked to see if it is safe to run it on the service's new machine.

This is useful if the post-deactivation script controls access to a networked resource and does not need any data from the current machine.

Returns:
boolean indicating whether to run the post-deactivation script on a different machine if the former host machine is not reachable.
Default Value:
false

setNonLocalPostAllowed

void setNonLocalPostAllowed(boolean allowNonLocalPost)
Sets the value of the NonLocalPostAllowed attribute.

Parameters:
allowNonLocalPost - indicating whether to run the post-deactivation script on a different machine if the former host machine is not reachable
See Also:
MigratableTargetMBean.isNonLocalPostAllowed()

getRestartOnFailure

boolean getRestartOnFailure()

Specifies whether or not a failed service will first be deactivated and reactivated in place, instead of being migrated.

The number of restart attempts is controlled by MigratableTargetMBean.getNumberOfRestartAttempts(). Once these restart attempts are exhausted, the service will migrate. A restarting migratable target will deactivate all services on it in order, then reactivate them all.

Returns:
Default Value:
false

setRestartOnFailure

void setRestartOnFailure(boolean restartOnFailure)
Sets the value of the RestartOnFailure attribute.

Parameters:
restartOnFailure -
See Also:
MigratableTargetMBean.getRestartOnFailure()

getSecondsBetweenRestarts

int getSecondsBetweenRestarts()

Specifies how many seconds to wait in between attempts to restart the failed service.

Returns:
Default Value:
30

setSecondsBetweenRestarts

void setSecondsBetweenRestarts(int seconds)
Sets the value of the SecondsBetweenRestarts attribute.

Parameters:
seconds - to pause between migratable target restart attempts
See Also:
MigratableTargetMBean.getSecondsBetweenRestarts()

getNumberOfRestartAttempts

int getNumberOfRestartAttempts()

Specifies how many restart attempts to make before migrating the failed service.

Note that these are consecutive attempts. If the value is set to 6, and the service restart fails 5 times before succeeding, but then fails again later, it will not instantly migrate. Each failure gets its own count of restart attempts.

A value of 0 is identical to setting MigratableTargetMBean.getRestartOnFailure() to false. A value of -1 indicates the service should never be migrated; instead, it will be restarted until it either works or the server shuts down.

Returns:
Default Value:
6

setNumberOfRestartAttempts

void setNumberOfRestartAttempts(int restartAttempts)
Sets the value of the NumberOfRestartAttempts attribute.

Parameters:
restartAttempts -
See Also:
MigratableTargetMBean.getNumberOfRestartAttempts()

Copyright 1996, 2010, 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
Oracle WebLogic Server MBean Javadoc
11g Release 1 (10.3.3)

Part Number E13945-03