All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.mb.ManagedBean

java.lang.Object
   |
   +----com.ibm.beans.mb.ManagedBean

public class ManagedBean
extends Object
implements MBInstanceInterface, Serializable
This class groups MBElements together. Each ManagedBean contains the following lists:

As in the RepositoryModel, interaction with a ManagedBean involves calling a selectXXX() method to select a subset of MBElements in the model, followed by a doXXX() call to perform an operation upon the selected MBElements. Notification support allows listeners to be informed of changes to the selection and to the RepositoryModel.

See Also:
MBElements, MBModelChangeEvent, MBModelChangeListener, MBSelectionChangeEvent, MBSelectionChangeListener

Constructor Index

 o ManagedBean()
Constructs a ManagedBean that is unaffiliated with a RepositoryModel.
 o ManagedBean(RepositoryModel)
Constructs a ManagedBean that is affiliated with the specified RepositoryModel.

Method Index

 o addMBModelChangeListener(MBModelChangeListener)
Adds a listener to the list.
 o addMBSelectionChangeListener(MBSelectionChangeListener)
Adds a listener to the list.
 o doAdd(MBElement)
Adds an MBElement to the ManagedBean.
 o doAdd(MBElement[])
Adds MBElements to the ManagedBean.
 o doCommonAdd(MBElement)
Adds an MBElement to the ManagedBean common storage.
 o doCommonAdd(MBElement[])
Adds an array of MBElements to the ManagedBean common storage.
 o doCommonDelete()
Deletes the currently selected common MBElements from the ManagedBean.
 o doCommonGetAsMonikers()
Gets an array of the MBMonikers of the currently selected common MBElements in this ManagedBean.
 o doCommonGetElements()
Gets an array of the currently selected common MBElements in this ManagedBean.
 o doDelete()
Deletes the currently selected MBElements from the ManagedBean.
 o doGetAsMonikers()
Gets an array of the MBMonikers of the currently selected MBElements in this ManagedBean.
 o doGetElements()
Gets an array of the currently selected MBElements in this ManagedBean.
 o dumpMB()
Dumps the contents of a ManagedBean.
 o fireMBModelChangeEvent(MBModelChangeEvent)
Distributes the event parameter to all registered listeners.
 o fireMBSelectionChangeEvent(MBSelectionChangeEvent)
Distributes the event parameter to all registered listeners.
 o getAllElements()
Gets an array of all of the MBElements in this ManagedBean.
 o getBeanCustomizerInstance()
Gets the Customizer associated with the ManagedBean.
 o getBeanInfoInstance()
Gets the BeanInfo associated with the ManagedBean.
 o getBeanInstance()
Gets the bean associated with the ManagedBean.
 o getBeanMBMoniker()
Gets the MBMoniker of the ManagedBean.
 o getBeanName()
Gets the bean name of the ManagedBean.
 o getCommonMBElements()
Gets the Vector of common MBElements in this ManagedBean.
 o getDelegator()
Reserved.
 o getIconInstance(int)
Gets the icon associated with the ManagedBean.
 o getMBElements()
Gets the Vector of MBElements in this ManagedBean.
 o getMBInstanceImpl()
Gets the MBInstanceInterface implementation to which this ManagedBean is delegating instance work.
 o getRepositoryMode()
Gets the mode of the RepositoryModel.
 o getRepositoryModel()
Gets the RepositoryModel with which this ManagedBean is affiliated.
 o getRepositoryName()
Gets the name of the RepositoryModel affiliated with this ManagedBean.
 o getSelectedCommonMBElements()
Gets the Vector of currently selected common MBElements in this ManagedBean.
 o getSelectedMBElements()
Gets the Vector of currently selected MBElements in this ManagedBean.
 o getWriteable()
Determines whether this ManagedBean has the ability to write.
 o isDirty()
Determines whether the ManagedBean is "dirty".
 o putManagedBean()
Writes the ByteArray representations of the MBElements in this ManagedBean into the working directory.
 o rawAdd(MBElement)
Adds an MBElement to the ManagedBean.
 o rawCommonAdd(MBElement)
Adds an MBElement to the common storage of the ManagedBean.
 o reconstituteManagedBean()
Re-reads all of the MBElement ByteArray information into each MBElement in this ManagedBean.
 o removeMBModelChangeListener(MBModelChangeListener)
Removes a listener from the list.
 o removeMBSelectionChangeListener(MBSelectionChangeListener)
Removes a listener from the list.
 o selectAll()
Selects all of the MBElements in this ManagedBean.
 o selectAllOfType(MBType)
Selects all of the MBElements of a the given type.
 o selectCommonAll()
Selects all of the common MBElements in this ManagedBean.
 o selectCommonAllOfType(MBType)
Selects all of the common MBElements of a given type.
 o selectCommonElement(MBElement)
Selects a specific common MBElement in this ManagedBean.
 o selectCommonNone()
If any common MBElements are selected, this method deselects them.
 o selectElement(MBElement)
Selects a specific MBElement in this ManagedBean.
 o selectNone()
If any MBElements are selected, this method deselects them.
 o setBeanMBMoniker(MBMoniker)
Sets the MBMoniker of this ManagedBean.
 o setBeanName(String)
Sets the bean name of the ManagedBean.
 o setCommonMBElements(Vector)
Sets the Vector of common MBElements in this ManagedBean.
 o setDelegator(ManagedBean)
Reserved.
 o setDirtyBit(boolean)
Sets or resets the "dirty" bit.
 o setMBElements(Vector)
Sets the Vector of MBElements in this ManagedBean.
 o setMBInstanceImpl(MBInstanceInterface)
Points this ManagedBean at an Object that implements the MBInstanceInterface interface.
 o setRepositoryModel(RepositoryModel)
Sets the RepositoryModel affiliation for this ManagedBean.
 o setRepositoryName(String)
Sets the name of the RepositoryModel affiliated with this ManagedBean.
 o setSelectedCommonMBElements(Vector)
Sets the Vector of currently selected common MBElements in this ManagedBean.
 o setSelectedMBElements(Vector)
Sets the Vector of currently selected MBElements in this ManagedBean.
 o setWriteable(boolean)
Sets or resets whether this ManagedBean has the ability to write.
 o slashesToDots(String)
Converts a moniker that uses slashes to one that uses period delimiters.
 o unputManagedBean(boolean)
Removes any ByteArray representations of the MBElements in this ManagedBean from the working directory.
 o writeManagedBean(String)
Writes the ByteArray representations of the MBElements in this ManagedBean into directory dir.
 o writeManagedBeanCommon(String)
Writes the ByteArray representations of the common MBElements in this ManagedBean into directory dir.

Constructors

 o ManagedBean
 public ManagedBean()
Constructs a ManagedBean that is unaffiliated with a RepositoryModel.

 o ManagedBean
 public ManagedBean(RepositoryModel r)
Constructs a ManagedBean that is affiliated with the specified RepositoryModel.

Parameters:
r - The RepositoryModel to be associated with this ManagedBean.

Methods

 o selectAll
 public synchronized void selectAll()
Selects all of the MBElements in this ManagedBean.

See Also:
MBElement
 o selectNone
 public synchronized void selectNone()
If any MBElements are selected, this method deselects them.

See Also:
MBElement
 o selectElement
 public synchronized void selectElement(MBElement e) throws IllegalAccessException
Selects a specific MBElement in this ManagedBean. Any previously selected MBElements are first deselected.

Parameters:
e - The MBElement to be selected.
Throws: IllegalAccessException
Thrown if this method attempts to index outside the range of the Vector.
See Also:
MBElement
 o selectAllOfType
 public synchronized void selectAllOfType(MBType t)
Selects all of the MBElements of a the given type. For example:
 selectAllOfType(new MBType("com.ibm.beans.mb.MBBeanClass");
 
Any previously selected MBElements are first deselected.

Parameters:
t - The MBElement type.
See Also:
MBType, MBElement
 o selectCommonAll
 public synchronized void selectCommonAll()
Selects all of the common MBElements in this ManagedBean.

See Also:
MBElement
 o selectCommonNone
 public synchronized void selectCommonNone()
If any common MBElements are selected, this method deselects them.

See Also:
MBElement
 o selectCommonElement
 public synchronized void selectCommonElement(MBElement e) throws IllegalAccessException
Selects a specific common MBElement in this ManagedBean. Any previously selected MBElements are first deselected.

Parameters:
e - The common MBElement to be selected.
Throws: IllegalAccessException
Thrown if this method attempts to index outside the range of the Vector.
See Also:
MBElement
 o selectCommonAllOfType
 public synchronized void selectCommonAllOfType(MBType t)
Selects all of the common MBElements of a given type. Any previously selected MBElements are first deselected.

Parameters:
t - The common MBElement type.
See Also:
MBType, MBElement
 o doDelete
 public synchronized void doDelete()
Deletes the currently selected MBElements from the ManagedBean. All registered ModelChange listeners are informed of this change.

See Also:
MBElement
 o doAdd
 public synchronized void doAdd(MBElement e[])
Adds MBElements to the ManagedBean. All registered ModelChange listeners are informed of this change.

Parameters:
e - An array of MBElements to add to the ManagedBean.
See Also:
MBElement
 o doAdd
 public synchronized void doAdd(MBElement e)
Adds an MBElement to the ManagedBean. All registered ModelChange listeners are informed of this change.

Parameters:
e - The MBElement to add to the ManagedBean.
See Also:
MBElement
 o rawAdd
 protected synchronized void rawAdd(MBElement e)
Adds an MBElement to the ManagedBean. No registered ModelChange listeners are informed of this change.

Parameters:
e - The MBElement to add to the ManagedBean.
See Also:
MBElement
 o doCommonDelete
 public synchronized void doCommonDelete()
Deletes the currently selected common MBElements from the ManagedBean. All registered ModelChange listeners are informed of this change.

See Also:
MBElement
 o doCommonAdd
 public synchronized void doCommonAdd(MBElement e[])
Adds an array of MBElements to the ManagedBean common storage. These common MBElements will be added to all of the ManagedBeans in the RepositoryModel. All registered ModelChange listeners are informed of this change.

Parameters:
e - An array of MBElements to add to the common storage of the ManagedBean.
See Also:
MBElement
 o doCommonAdd
 public synchronized void doCommonAdd(MBElement e)
Adds an MBElement to the ManagedBean common storage. This common MBElement will be added to all of the ManagedBeans in the RepositoryModel. All registered ModelChange listeners are informed of this change.

Parameters:
e - The MBElement to add to the common storage of the ManagedBean.
See Also:
MBElement
 o rawCommonAdd
 protected synchronized void rawCommonAdd(MBElement e)
Adds an MBElement to the common storage of the ManagedBean. No registered ModelChange listeners are informed of this change. This method does not add the MBElement to every ManagedBean in the RepositoryModel.

Parameters:
e - The MBElement to add to the common storage of the ManagedBean.
See Also:
MBElement
 o doGetElements
 public synchronized MBElement[] doGetElements()
Gets an array of the currently selected MBElements in this ManagedBean.

Returns:
An array of the currently selected MBElements in this ManagedBean.
See Also:
MBElement
 o getAllElements
 public synchronized MBElement[] getAllElements()
Gets an array of all of the MBElements in this ManagedBean.

Returns:
An array of the currently selected MBElements in this ManagedBean.
See Also:
MBElement
 o doGetAsMonikers
 public synchronized MBMoniker[] doGetAsMonikers()
Gets an array of the MBMonikers of the currently selected MBElements in this ManagedBean.

Returns:
An array of MBMonikers of the currently selected MBElements in this ManagedBean.
See Also:
MBElement, MBMoniker
 o doCommonGetElements
 public synchronized MBElement[] doCommonGetElements()
Gets an array of the currently selected common MBElements in this ManagedBean.

Returns:
An array of the currently selected common MBElements in this ManagedBean.
See Also:
MBElement
 o doCommonGetAsMonikers
 public synchronized MBMoniker[] doCommonGetAsMonikers()
Gets an array of the MBMonikers of the currently selected common MBElements in this ManagedBean.

Returns:
An array of MBMonikers of the currently selected common MBElements in this ManagedBean.
See Also:
MBElement, MBMoniker
 o setRepositoryModel
 public synchronized void setRepositoryModel(RepositoryModel r)
Sets the RepositoryModel affiliation for this ManagedBean.

Parameters:
r - The RepositoryModel for this ManagedBean.
See Also:
RepositoryModel
 o getRepositoryModel
 public RepositoryModel getRepositoryModel()
Gets the RepositoryModel with which this ManagedBean is affiliated.

Returns:
The RepositoryModel with which this ManagedBean is affiliated.
See Also:
RepositoryModel
 o setRepositoryName
 public synchronized void setRepositoryName(String name)
Sets the name of the RepositoryModel affiliated with this ManagedBean.

Parameters:
name - The name of the RepositoryModel.
See Also:
RepositoryModel
 o getRepositoryName
 public synchronized String getRepositoryName()
Gets the name of the RepositoryModel affiliated with this ManagedBean. If this ManagedBean no longer refers to a valid RepositoryModel, this method can return a locally cached copy of the name of the last RepositoryModel with which this ManagedBean was last associated.

Returns:
The RepositoryModel name.
See Also:
RepositoryModel
 o getRepositoryMode
 public synchronized int getRepositoryMode()
Gets the mode of the RepositoryModel. If this ManagedBean is not currently affiliated with a RepositoryModel, this method returns a locally cached copy of the mode of the last RepositoryModel with which it was affiliated.

Returns:
RepositoryModel mode. The mode is one of the following:
  • RepositoryModel.READ_ONLY
  • RepositoryModel.WRITE_ONLY
  • RepositoryModel.READ_WRITE
Or -1 if there is no RepositoryModel affiliated with this ManagedBean.
See Also:
RepositoryModel
 o setWriteable
 public synchronized void setWriteable(boolean w)
Sets or resets whether this ManagedBean has the ability to write.

Parameters:
w - true if this ManagedBean is writeable, false otherwise.
 o getWriteable
 public boolean getWriteable()
Determines whether this ManagedBean has the ability to write.

Returns:
true if this ManagedBean is writeable, false otherwise.
 o setBeanMBMoniker
 public synchronized void setBeanMBMoniker(MBMoniker m)
Sets the MBMoniker of this ManagedBean.

Parameters:
m - The new MBMoniker.
 o getBeanMBMoniker
 public MBMoniker getBeanMBMoniker()
Gets the MBMoniker of the ManagedBean.

Returns:
The MBMoniker of this ManagedBean.
 o setBeanName
 public synchronized void setBeanName(String n)
Sets the bean name of the ManagedBean. The bean name is the base name of all of the bean components in this ManagedBean.

Parameters:
n - The new bean name.
 o getBeanName
 public String getBeanName()
Gets the bean name of the ManagedBean. The bean name is the base name of all of the bean components in this ManagedBean.

Returns:
The bean name of this ManagedBean.
 o getMBInstanceImpl
 public MBInstanceInterface getMBInstanceImpl()
Gets the MBInstanceInterface implementation to which this ManagedBean is delegating instance work.

Returns:
The MBInstanceInterface implementation to which this ManagedBean is delegating instance work.
 o setMBInstanceImpl
 public synchronized void setMBInstanceImpl(MBInstanceInterface delegate)
Points this ManagedBean at an Object that implements the MBInstanceInterface interface.

Parameters:
delegate - An Object that implements the MBInstanceInterface interface.
 o getIconInstance
 public synchronized Image getIconInstance(int iconKind)
Gets the icon associated with the ManagedBean.

Parameters:
iconKind - The kind of icon requested. This should be one of the constant values
  • BeanInfo.ICON_COLOR_16x16
  • BeanInfo.ICON_COLOR_32x32
  • BeanInfo.ICON_MONO_16x16
  • BeanInfo.ICON_MONO_32x32
Returns:
The icon associated with the ManagedBean
See Also:
Image, MBInstanceImpl
 o getBeanInstance
 public synchronized Object getBeanInstance()
Gets the bean associated with the ManagedBean.

Returns:
The bean associated with the ManagedBean.
See Also:
Object, MBInstanceImpl
 o getBeanInfoInstance
 public synchronized BeanInfo getBeanInfoInstance()
Gets the BeanInfo associated with the ManagedBean.

Returns:
The BeanInfo associated with the ManagedBean.
See Also:
BeanInfo, MBInstanceImpl
 o getBeanCustomizerInstance
 public synchronized Customizer getBeanCustomizerInstance()
Gets the Customizer associated with the ManagedBean.

Returns:
The Customizer associated with the ManagedBean.
See Also:
Customizer, MBInstanceImpl
 o addMBModelChangeListener
 public void addMBModelChangeListener(MBModelChangeListener l)
Adds a listener to the list.

Parameters:
l - The listener being added.
 o removeMBModelChangeListener
 public void removeMBModelChangeListener(MBModelChangeListener l)
Removes a listener from the list.

Parameters:
l - The listener being removed.
 o fireMBModelChangeEvent
 protected void fireMBModelChangeEvent(MBModelChangeEvent e)
Distributes the event parameter to all registered listeners.

Parameters:
e - The event being distributed.
 o addMBSelectionChangeListener
 public void addMBSelectionChangeListener(MBSelectionChangeListener l)
Adds a listener to the list.

Parameters:
l - The listener being added.
 o removeMBSelectionChangeListener
 public void removeMBSelectionChangeListener(MBSelectionChangeListener l)
Removes a listener from the list.

Parameters:
l - The listener being removed.
 o fireMBSelectionChangeEvent
 protected void fireMBSelectionChangeEvent(MBSelectionChangeEvent e)
Distributes the event parameter to all registered listeners.

Parameters:
e - The event being distributed.
 o getMBElements
 protected Vector getMBElements()
Gets the Vector of MBElements in this ManagedBean.

Returns:
The Vector of MBElements in this ManagedBean.
See Also:
MBElement
 o setMBElements
 protected void setMBElements(Vector mbv)
Sets the Vector of MBElements in this ManagedBean.

Parameters:
mbv - The Vector of MBElements to be set in this ManagedBean.
See Also:
MBElement
 o getSelectedMBElements
 public synchronized Vector getSelectedMBElements()
Gets the Vector of currently selected MBElements in this ManagedBean.

Returns:
The Vector of currently selected MBElements in this ManagedBean.
See Also:
MBElement
 o setSelectedMBElements
 protected synchronized void setSelectedMBElements(Vector mbv)
Sets the Vector of currently selected MBElements in this ManagedBean.

Parameters:
mbv - The Vector of MBElements to be set as selected in this ManagedBean.
See Also:
MBElement
 o getCommonMBElements
 protected Vector getCommonMBElements()
Gets the Vector of common MBElements in this ManagedBean.

Returns:
The Vector of common MBElements in this ManagedBean.
See Also:
MBElement
 o setCommonMBElements
 protected void setCommonMBElements(Vector mbv)
Sets the Vector of common MBElements in this ManagedBean.

Parameters:
mbv - The Vector of common MBElements to be set in this ManagedBean.
See Also:
MBElement
 o getSelectedCommonMBElements
 public synchronized Vector getSelectedCommonMBElements()
Gets the Vector of currently selected common MBElements in this ManagedBean.

Returns:
The Vector of currently selected common MBElements in this ManagedBean.
See Also:
MBElement
 o setSelectedCommonMBElements
 protected synchronized void setSelectedCommonMBElements(Vector mbv)
Sets the Vector of currently selected common MBElements in this ManagedBean.

Parameters:
mbv - The Vector of common MBElements to be set as selected in this ManagedBean.
See Also:
MBElement
 o slashesToDots
 public String slashesToDots(String s)
Converts a moniker that uses slashes to one that uses period delimiters. For example, this method would convert:
com/jars/myjar
to:
com.jars.myjar

 o writeManagedBean
 public synchronized boolean writeManagedBean(String dir)
Writes the ByteArray representations of the MBElements in this ManagedBean into directory dir.

Parameters:
dir - The target directory for the write.
Returns:
true if write was successful, false otherwise.
 o writeManagedBeanCommon
 public synchronized boolean writeManagedBeanCommon(String dir)
Writes the ByteArray representations of the common MBElements in this ManagedBean into directory dir.

Parameters:
dir - The target directory for the write.
Returns:
true if write was successful, false otherwise.
 o putManagedBean
 public synchronized boolean putManagedBean()
Writes the ByteArray representations of the MBElements in this ManagedBean into the working directory.

Returns:
true if write was successful, false otherwise.
 o unputManagedBean
 public synchronized boolean unputManagedBean(boolean forceCommon)
Removes any ByteArray representations of the MBElements in this ManagedBean from the working directory. Note that this unsets the "dirty bit", thus indicating that the ManagedBean needs to be re-written to the working directory when an instantiation request is made.

Parameters:
forceCommon - true to force removal of Common MBElements, false otherwise. A user will typically call this method with a parameter of false, which will result in the Common MBElements being removed from the working directory only when the ManagedBean is unaffiliated with a RepositoryModel, or the ManagedBean is the last ManagedBean in a RepositoryModel.
Returns:
true if write was successful, false otherwise.
 o isDirty
 protected boolean isDirty()
Determines whether the ManagedBean is "dirty". A ManagedBean is considered to be dirty if it has changed. A dirty ManagedBean should be written into the working directory again when an instantiation request is made.

Returns:
true if "dirty", false otherwise.
 o setDirtyBit
 protected void setDirtyBit(boolean v)
Sets or resets the "dirty" bit. Setting a dirty bit indicates that the ManagedBean has changed and should be written to the working directory when an instantiation request is made.

Parameters:
v - true if "dirty", false otherwise.
 o reconstituteManagedBean
 protected synchronized boolean reconstituteManagedBean()
Re-reads all of the MBElement ByteArray information into each MBElement in this ManagedBean.

Returns:
true if successful, false otherwise.
 o getDelegator
 public ManagedBean getDelegator()
Reserved.

 o setDelegator
 public void setDelegator(ManagedBean mb)
Reserved.

 o dumpMB
 public synchronized void dumpMB()
Dumps the contents of a ManagedBean.


All Packages  Class Hierarchy  This Package  Previous  Next  Index