KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > wsmgmt > pool > spi > Pool


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.admin.wsmgmt.pool.spi;
24
25 import java.util.Collection JavaDoc;
26
27 /**
28  * Pool used to keep track of SOAP messages.
29  */

30 public interface Pool {
31
32     /**
33      * Returns the name of this pool.
34      *
35      * @return name of this pool
36      */

37     public String JavaDoc getName();
38
39     /**
40      * Returns the object for the given key.
41      *
42      * @param key key used to put objects in the pool
43      *
44      * @return object for the given key or null
45      */

46     public Object JavaDoc get(Object JavaDoc key);
47
48     /**
49      * Adds the object to the pool.
50      *
51      * @param key key used to put this object
52      * @param val actual object to be added to the pool
53      *
54      * @return previous value for this key or null
55      */

56     public Object JavaDoc put(Object JavaDoc key, Object JavaDoc val);
57
58     /**
59      * Removes this keyed entry from the pool.
60      *
61      * @param key key of the entry that is targeted to be removed
62      *
63      * @return removed entry or null if key not found
64      */

65     public Object JavaDoc remove(Object JavaDoc key);
66
67     /**
68      * Removes all mappings from this pool.
69      */

70     public void clear();
71
72     /**
73      * Returns the number of mappings in this pool.
74      *
75      * @return current number of mappings in this pool
76      */

77     public int size();
78
79     /**
80      * Returns the maximum number of mappings allowed in this pool.
81      *
82      * @return max number of mappings allowed
83      */

84     public int getMaxSize();
85
86     /**
87      * Returns true if this pool contains mapping for the specified key.
88      *
89      * @param key the presence of the key to be tested
90      *
91      * @return true if this pool contains mapping for the specified key
92      */

93     public boolean containsKey(Object JavaDoc key);
94
95     /**
96      * Returns true if this pool contains mapping for the specified value.
97      *
98      * @param val the presence of the value to be tested
99      *
100      * @return true if this pool contains mapping for the specified value
101      */

102     public boolean containsValue(Object JavaDoc val);
103
104     /**
105      * Returns a collection view of the values contained in this pool.
106      *
107      * @return a collection view of the values contained in this pool
108      */

109     public Collection JavaDoc values();
110
111     /**
112      * Resets the max size of the pool. If new size is less than current
113      * size, all extra entries in the pool will be removed.
114      *
115      * @param size new max size of the pool
116      */

117     public void resize(int size);
118 }
119
Popular Tags