View Javadoc

1   /*
2   * Licensed to the Apache Software Foundation (ASF) under one or more
3   * contributor license agreements.  See the NOTICE file distributed with
4   * this work for additional information regarding copyright ownership.
5   * The ASF licenses this file to You under the Apache License, Version 2.0
6   * (the "License"); you may not use this file except in compliance with
7   * the License.  You may obtain a copy of the License at
8   *
9   *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17  /***
18   * Created on Jan 13, 2004
19   *
20   * 
21   * @author
22   */
23  package org.apache.jetspeed.deployment.simpleregistry;
24  
25  import java.util.Collection;
26  
27  /***
28   * <p>
29   * SimpleRegistry
30   * </p>
31   * <p>
32   *   This is an interface for creating simple registry systems.  A good example would be an
33   *   in memory registry that gets populate at runtime and is lost on shutdown.
34   * 
35   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
36   * @version $Id: SimpleRegistry.java 516881 2007-03-11 10:34:21Z ate $
37   *
38   */
39  public interface SimpleRegistry
40  {
41  	/***
42  	 * Registers the entry.
43  	 * 
44  	 * @throws java.lang.IllegalAgrumentException in <code>entry</code> is null or
45  	 * <code>entry.getId()</code> is null
46  	 * @throws org.apache.jetspeed.cps.simpleregistry if this <code>entry</code> is 
47  	 * already registered.
48  	 * @param entry
49  	 */
50  	public void register(Entry entry) throws SimpleRegistryException;
51  	
52  	/***
53  	 * De-registers the entry
54  	 * @param entry
55  	 * @throws java.lang.IllegalAgrumentException in <code>entry</code> is null or
56  	 * <code>entry.getId()</code> is null
57  	 */
58  	public void deRegister(Entry entry);
59  	
60  	/***
61  	 * Verifies whether or not this entry is registered.
62  	 * @param entry
63  	 * 
64  	 * @return boolean <code>true</code> is the <code>entry</code> is registered
65  	 * otherwise <code>false</code>.
66  	 * @throws java.lang.IllegalAgrumentException in <code>entry</code> is null or
67  	 * <code>entry.getId()</code> is null
68  	 */
69  	public boolean isRegistered(Entry entry);
70  	
71  	/***
72  	 * Provides a Cloolection of <code>org.apache.jetspeed.cps.simpleregistry.Entry</code>
73  	 * objects that are currently registered to this registery
74  	 * @return
75  	 */	
76  	public Collection getRegistry();
77  
78  }