asgaard.skid
Class SkidBeanContainer

java.lang.Object
  |
  +--asgaard.skid.SkidBean
        |
        +--asgaard.skid.SkidBeanContainer

public class SkidBeanContainer
extends SkidBean

Implementation of an wrapper for a Streamable Object carried by an DataBeanContainer, including the functionality (persistence) of an SkidBean.

Important: Key values which are accessible via the RemoteBroker have to be defined following the Java-Beans-Convention using the getXXXX methods for key-generation.

Remark: All attribues used by the Object which are not intended to be persitent have to be declared transient and restored by default or the parameterless constructor.

Minimal Usage: (The RemoteBroker should be instanciated at this time) SkidBean b = new SkidBean( );
b.setName() (optional)
b.flush();

See Also:
SkidBean, Serialized Form

Fields inherited from class asgaard.skid.SkidBean
broker, debug, history_policy, LAST_METHOD
 
Constructor Summary
SkidBeanContainer(java.lang.Object contain)
          Creates a Conainer wrapping a given object.
 
Method Summary
 java.lang.reflect.Method[] getMethods()
          Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by this Class object, including those declared by the wrapped object.
 java.lang.String getName()
          Returns the name of the Bean which shold be human readable and may be unique in some cases, but this is not strictly required.
 java.lang.Object getObject()
          Returns the wrapped Object
 java.lang.Object invoke(java.lang.String name, java.lang.Object[] args, boolean modify)
          Invokes the underlying method represented by this Method object, on the specified object with the specified parameters.
 void setObject(java.lang.Object contain)
          Sets (replaces if any before) the given objects.
 
Methods inherited from class asgaard.skid.SkidBean
addEvent, cloneBean, flush, getAge, getBeanType, getBroker, getChangeHistory, getClassKey, getCreated, getEvent, getFilter, getIdentifier, getKey, getLink, getModified, getUpdatePolicy, init, isChanged, isNew, isReadOnly, modify, putLink, setAge, suscribeEvent, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkidBeanContainer

public SkidBeanContainer(java.lang.Object contain)
                  throws java.lang.Exception
Creates a Conainer wrapping a given object.
Parameters:
contain - the wrapped object
Throws:
SkidException - if the given Object is not Serializable
Method Detail

getName

public java.lang.String getName()
Returns the name of the Bean which shold be human readable and may be unique in some cases, but this is not strictly required.
Overrides:
getName in class SkidBean

setObject

public void setObject(java.lang.Object contain)
               throws SkidException
Sets (replaces if any before) the given objects.
Parameters:
contain - the wrapped object
Throws:
SkidException - if the given Object is not Serializable
Overrides:
setObject in class SkidBean

getObject

public java.lang.Object getObject()
Returns the wrapped Object
Returns:
the object, if any.
Overrides:
getObject in class SkidBean

getMethods

public java.lang.reflect.Method[] getMethods()
                                      throws java.lang.SecurityException
Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by this Class object, including those declared by the wrapped object.
Throws:
java.lang.SecurityException - if access to the information is denied.
Overrides:
getMethods in class SkidBean

invoke

public java.lang.Object invoke(java.lang.String name,
                               java.lang.Object[] args,
                               boolean modify)
                        throws java.lang.IllegalAccessException,
                               java.lang.IllegalArgumentException,
                               java.lang.reflect.InvocationTargetException,
                               java.lang.NullPointerException,
                               java.lang.NoSuchMethodException
Invokes the underlying method represented by this Method object, on the specified object with the specified parameters. Individual parameters are automatically unwrapped to match primitive formal parameters, and both primitive and reference parameters are subject to widening conversions as necessary. The value returned by the underlying method is automatically wrapped in an object if it has a primitive type.

Search order: First methods of the SkidBeanContainer are invoked before the Methods of the wrapped Object are invoked.

Parameters:
name - the name of the Method
args - the Arguments
modify - call the modify-method too? (not including undo)
Returns:
a result returned (if any)
Throws:
java.lang.IllegalAccessException - if the underlying method is inaccessible.
java.lang.IllegalArgumentException - if the number of actual and formal parameters differ, or if an unwrapping conversion fails.
java.lang.reflect.InvocationTargetException - if the underlying method throws an exception.
java.lang.NullPointerException - if the specified object is null.
java.lang.NoSuchMethodException - if there is no Method with this name
Overrides:
invoke in class SkidBean
See Also:
Method.invoke(java.lang.Object, java.lang.Object[])