Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.webapps.bean
Interface Actor  view Actor download Actor.java

All Superinterfaces:
EntityBean, java.io.Serializable, User
All Known Implementing Classes:
SimpleActor

public interface Actor
extends User

Abstract class for all objects that wrap a registered user of a Runtime Webapp.

Different modules will want to add to the properties of a basic User: the school module has Students and Staff, the content management system will have Authors etc. Each of these should be implemented as wrappers of User that implement this Actor interface.

There are three ways of getting an Actor:

  1. If you have an existing User and want to 'promote' them to an Actor then construct a new actor using RuntimeParameters.getStore().create, and set the User with setUser.
  2. If there is an existing actor in the DB for which you have the id, then get it using RuntimeParameters.getStore().get -- this will fill in the wrapped user as required.
  3. If there is an existing actor in the DB, but you only have the User that it wraps, then get it using getActorForUser().

An Actor should act like any other EntityBean. In particular it must implement the two constructors:

And, as with all other EntityBeans, these constructors should never be called directly but only via the RuntimeParameters.getStore().

Version:
$Id: Actor.java,v 1.5 2003/09/30 15:13:08 joe Exp $

Field Summary
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.User
DATABASE_TABLE
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
INTERFACE_BEAN, NULL_ID
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Get the value of an attribute.
 User getUser()
          Get the User that this Actor wraps.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set the value of an attribute.
 void setUser(User user)
          Set the User that this Actor wraps.
 
Methods inherited from interface com.RuntimeCollective.webapps.bean.User
addRole, getAddress, getCreateDate, getEmail, getFirstName, getLastName, getPassword, getRoles, hasRole, removeRole, setAddress, setCreateDate, setEmail, setFirstName, setLastName, setPassword, setRoles
 
Methods inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
delete, getId, save, setId
 

Method Detail

getUser

public User getUser()
Get the User that this Actor wraps.


setUser

public void setUser(User user)
Set the User that this Actor wraps.


getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Get the value of an attribute.

Specified by:
getAttribute in interface User

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Set the value of an attribute.

Specified by:
setAttribute in interface User