View Javadoc

1   /* (c) Copyright 2003 Caleigo AB, All rights reserved. 
2    * 
3    * This library is free software; you can redistribute it and/or
4    * modify it under the terms of the GNU Lesser General Public
5    * License as published by the Free Software Foundation; either
6    * version 2.1 of the License, or (at your option) any later version.
7    * 
8    * This library is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11   * Lesser General Public License for more details.
12   * 
13   * You should have received a copy of the GNU Lesser General Public
14   * License along with this library; if not, write to the Free Software
15   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16   *  
17   */
18  
19  package org.caleigo.core;
20  
21  import org.caleigo.core.event.*;
22  
23  /*** A IProxyEntity is an extension of the IEntity interface for entity objects
24   * that act as proxies to other entity objects or may even be wrappers around
25   * other forms of property providers. <BR><BR> 
26   *
27   * The proxy's remote object is the object that the proxy refers to. 
28   * Proxy objects may be chained to other proxies in several layers and
29   * the first non proxy object in achain is defined as the source object.
30   * The remote/source object can be null in which case all access to field  
31   * data in the proxy will return the default value defined by the proxy's
32   * descriptors. 
33   *
34   * @author  Dennis Zikovic
35   * @version 1.00
36   *
37   *//* 
38   *
39   * WHEN        WHO               WHY & WHAT
40   * -----------------------------------------------------------------------------
41   * 2001-11-08  Dennis Zikovic    Creation
42   */
43  public interface IProxyEntity extends IEntity
44  {
45      // Methods -----------------------------------------------------------------
46      
47      /*** Boolean access method that returns true if the proxy has a remote
48       * entity if false then getRemoteEntity() will return null.
49       */
50      public boolean hasRemoteEntity();
51      
52      /*** Access method that returns the remote entity of the proxy.
53       * May return null if the proxy does not currently have a remote.
54       */
55      public IEntity getRemoteEntity();
56      
57      /*** Boolean access method that returns true if the proxy has a source
58       * entity if false then getSourceEntity() will return null.
59       */
60      public boolean hasSourceEntity();
61      
62      /*** Access method that returns the source entity of the proxy.
63       * May return null if the proxy does not currently have a source entity.
64       */
65      public IEntity getSourceEntity();
66      
67      /*** Optional mutation method that throws an UnsupportedOperationException 
68       * if the implementing class does not support the method.
69       */
70      public void setRemoteEntity(IEntity entity);
71      
72      /*** Adds IProxyListener to receive notifications of performed 
73       * data operations on the entity object.
74       */
75      public void addProxyListener(IProxyListener listener);
76      
77      /*** Removes the specified IProxyListener from the entity object.
78       */
79      public void removeProxyListener(IProxyListener listener);
80  }
81