KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > component > ComponentKeeperConfiguration


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.core.component;
19
20 import org.sape.carbon.core.component.factory.ComponentFactoryConfiguration;
21 import org.sape.carbon.core.config.Configuration;
22
23 /**
24  * <p>Configuration interface for the ComponentKeeper.</p>
25  *
26  * Copyright 2002 Sapient
27  * @since carbon 1.0
28  * @author Douglas Voet, January 2002
29  * @version $Revision: 1.14 $($Author: dvoet $ / $Date: 2003/05/05 21:21:11 $)
30  */

31 public interface ComponentKeeperConfiguration extends Configuration {
32     /**
33      * <p>Gets the <code>Class</code> implementing <code>ComponentKeeper</code>
34      * that the Core Carbon will use.</p>
35      *
36      * @return Class object for a class implementing ComponentKeeper
37      */

38     Class JavaDoc getComponentKeeperFactoryClass();
39     /**
40      * Sets the Class that implements the component
41      * keeper factory.
42      * @param value The implementing Class for the component keeper
43      * factory.
44      */

45     void setComponentKeeperFactoryClass(Class JavaDoc value);
46
47     /**
48      * <p>Gets the <code>Class</code> implementing <code>ComponentFactory</code>
49      * that the keeper will instantiate and use to build all components.</p>
50      *
51      * @return ComponentFactoryConfiguration object used to configure the
52      * ComponentFactory used in the keeper
53      */

54     ComponentFactoryConfiguration getComponentFactoryConfiguration();
55
56     /**
57      * <p>Gets the number of milliseconds a thread should wait between checks
58      * to see if a component has been created or not. This is used when there
59      * are concurrent requests for the same component that have yet to be
60      * constructed. All threads waiting for the first thread to build the
61      * component will check the status at this interval.</p>
62      * <p>If this value is too short, performance of the system will degrade.
63      * If this value is too long, there will be RARE cases of threads taking
64      * at least this long return from fetchComponent. This value should never
65      * be zero or else there may be cases of threads blocking forever.</p>
66      *
67      * @return Class object for a class implementing ComponentFactory
68      */

69     long getNewComponentCheckInterval();
70     /**
71      * Sets the delay time for how long a component may take
72      * to start. If a component takes longer than this amount of
73      * time, the operation will timeout.
74      * @param value the amount of time, in milleseconds, that a
75      * component may take to start.
76      */

77     void setNewComponentCheckInterval(long value);
78
79     /**
80      * The default for if a shutdown hook should be registered with
81      * the JVM. Defaults to true.
82      */

83     boolean RegisterShutdownHook = true;
84     /**
85      * <p>Determines if the component keeper should register a shutdown
86      * hook with the JVM in order to gracefully shutdown components. This
87      * results in the addition of a stopped thread object waiting for the
88      * JVM's shutdown system to initiate hooks.</p>
89      * @return true if a shutdown hook should be registered, false otherwise
90      */

91     boolean isRegisterShutdownHook();
92     /**
93      * Sets the configuration for if a shutdown hook should be
94      * registered with the JVM.
95      * @param value true if Carbon should register a JVM hook in
96      * order to shutdown all component gracefully when the
97      * JVM terminates. False otherwise.
98      */

99     void setRegisterShutdownHook(boolean value);
100 }
101
Popular Tags