WebLogic Integration


com.bea.wlpi.common.plugin
Class InfoObject

java.lang.Object
  |
  +--com.bea.wlpi.common.plugin.InfoObject
Direct Known Subclasses:
ActionCategoryInfo, ConfigurationInfo, EventHandlerInfo, FieldInfo, FunctionInfo, HelpSetInfo, PluginDependency, PluginInfo, TemplateDefinitionPropertiesInfo, TemplateNodeInfo, TemplatePropertiesInfo, VariableTypeInfo

public abstract class InfoObject
extends java.lang.Object
implements java.lang.Comparable, PluginConstants, java.io.Serializable

Abstract base class for all plugin metadata objects. Applications, and the server-side plugin runtime framework request plugin metadata for a specified locale, enabling a plugin to localize display strings and other resources appropriately. Every plugin is required to provide a globally unique internal identifier for itself, formed by appending one or more dot-separated strings to the vendor's reverse DNS name (for example, com.somedomain.someproduct.WLPIPlugin). InfoObject subclasses of which a plugin can provide multiple instances require a plugin-assigned identifier, which must be unique within the plugin/subclass combination. Plugins provide localized names and descriptions for the features they offer. They also specify the names of plugin-provided classes that implement the design-time and run-time behavior of these features.

Since:
WebLogic Process Integrator 2.0
Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Field Summary
protected  java.lang.String[] classNames
          An array containing the fully qualified Java class names of the plugin-provided implementation classes and customizers for this object type.
protected  java.lang.String description
          The localized description of this InfoObject.
protected  int ID
          The plugin-assigned ID for this InfoObject (unique within this plugin and subclass).
protected  java.lang.String name
          The localized name of this InfoObject.
protected  java.lang.String pluginName
          The unique name of the plugin providing this InfoObject.
 
Constructor Summary
protected InfoObject(java.lang.String pluginName, int ID, java.lang.String name, java.lang.String description, java.lang.String[] classNames)
          Create a new InfoObject.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare two InfoObject objects.
 boolean equals(java.lang.Object obj)
          Test two InfoObject objects for equality.
 java.lang.String getClassName(int key)
          Return the fully qualified name of a plugin-supplied Java class or resource.
 java.lang.String getDescription()
          Return the localized description.
 int getID()
          Return the unique plugin-supplied identifier for this InfoObject.
 java.lang.String getName()
          Return the localized name for this information.
 java.lang.String getPluginName()
          Return the name of the plugin providing this information.
static byte[] imageStreamToByteArray(java.io.InputStream in)
          Read an InputStream into a byte array.
 java.lang.String toString()
          Return a string representation of this InfoObject.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pluginName

protected java.lang.String pluginName
The unique name of the plugin providing this InfoObject.

ID

protected int ID
The plugin-assigned ID for this InfoObject (unique within this plugin and subclass).

name

protected java.lang.String name
The localized name of this InfoObject.

description

protected java.lang.String description
The localized description of this InfoObject.

classNames

protected java.lang.String[] classNames
An array containing the fully qualified Java class names of the plugin-provided implementation classes and customizers for this object type.
Constructor Detail

InfoObject

protected InfoObject(java.lang.String pluginName,
                     int ID,
                     java.lang.String name,
                     java.lang.String description,
                     java.lang.String[] classNames)
Create a new InfoObject.

Parameters:
pluginName - The reverse-DNS name of the plugin supplying this InfoObject.
ID - The unique plugin-supplied identifier for this InfoObject.
name - The localized name of this InfoObject.
description - A localized descriptive note about this InfoObject.
classNames - Array to identify plugin-supplied classes related to this InfoObject. The array contains one entry for each of the KEY_* values listed in the subclass. The value for each entry is the corresponding fully qualified Java class name. Some subclasses use this array for filenames rather than class names.
Method Detail

getPluginName

public final java.lang.String getPluginName()
Return the name of the plugin providing this information.

Returns:
The plugin name.

getID

public final int getID()
Return the unique plugin-supplied identifier for this InfoObject.

Returns:
The unique plugin-supplied identifier.

getName

public final java.lang.String getName()
Return the localized name for this information.

Returns:
The localized name.

getDescription

public final java.lang.String getDescription()
Return the localized description.

Returns:
The localized description.

getClassName

public final java.lang.String getClassName(int key)
Return the fully qualified name of a plugin-supplied Java class or resource.

Plugin-provided features are typically implemented by a server-side class that provides runtime behavior, and a client-side customizer that enables a workflow analyst to provide invocation parameters for the feature. Features that are customizable in this way also have the ability to serialize and deserialize themselves to and from an XML representation. XML persistence is managed by plugin-provided objects that implement the PluginData interface (read/write support as required by design-time clients), and objects that implement the PluginObject interface (read-only support as required by the runtime engine).

Plugins require no client-side installation or configuration - these classes and their instances are all downloaded dynamically using the RMI ClassLoader. The design-time client and run-time engine call the PluginManager.getPluginObject(java.lang.String, java.lang.String, java.util.Locale) method to retrieve instances of the implementation/customizer/serializer classes described by the corresponding InfoObject.

Parameters:
key - Classname key, defined by subclasses of InfoObject.
Returns:
A Java class name, if supported by the plugin.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the key parameter lies outside the range supported by this information type.

toString

public java.lang.String toString()
Return a string representation of this InfoObject.

Returns:
The string representation.
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Test two InfoObject objects for equality.

Parameters:
obj - Object with which to compare this one.
Returns:
true if obj is an instance of InfoObject with the same description as this one.
Overrides:
equals in class java.lang.Object
See Also:
compareTo(java.lang.Object)

compareTo

public int compareTo(java.lang.Object o)
Compare two InfoObject objects.
Specified by:
compareTo in interface java.lang.Comparable

Parameters:
o - Object with which to compare this one.
Returns:
The result of comparing the description members using the String.compareTo(Object) method.
Throws:
java.lang.ClassCastException - if the o parameter is not of a compatible class.
See Also:
equals(java.lang.Object)

imageStreamToByteArray

public static final byte[] imageStreamToByteArray(java.io.InputStream in)
                                           throws java.io.IOException
Read an InputStream into a byte array. The method closes the input stream after it has read it to completion.

Parameters:
in - An InputStream object to read.
Returns:
The resulting array of bytes.
Throws:
java.io.IOException - if an I/O error occurs.

WebLogic Integration

WebLogic Integration (WLI)