- 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:
- 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.
- 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.
- 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:
Actor() -- should generate a new Actor with a new unique ID, though the underlying user should remain null.
Actor(int id) -- should get an existing Actor from the database for this ID. It should also get the corresponding User from the RuntimeParameters.getStore().
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 $
| 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 |
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