KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > server > ondemand > entry > EntryContext


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
24 package com.sun.enterprise.server.ondemand.entry;
25
26 import com.sun.enterprise.server.ServerContext;
27
28
29 /**
30  * Context of an entry to a servicegroup.
31  * Each entry point generate such an EntryContext.
32  * This object contains information regarding the entry.
33  * Servicegroups use this EntryContext to examine the
34  * entry request.
35  *
36  * @author Binod PG
37  * @see EntryPoint
38  * @see ServerEntryListener
39  * @see ServiceGroup
40  */

41 public class EntryContext {
42
43     private Object JavaDoc context = null;
44     private int type = -1;
45     private ServerContext sc = null;
46
47     /**
48      * Creates an entrycontext.
49      * @param context COntext generated by entrypoints.
50      * @param type One of the types specified in
51      * <code>EntryPoint</code> interface
52      */

53     public EntryContext(Object JavaDoc context, int type) {
54         this.context = context;
55         this.type = type;
56     }
57
58     // Return the type of entry.
59
public int getEntryPointType() {
60         return this.type;
61     }
62
63     // Set the entry point type
64
public void setEntryPointType (int type) {
65         this.type = type;
66     }
67
68     // Return the actual entry context.
69
public Object JavaDoc get() {
70         return context;
71     }
72
73     // Set the server context object. This will be used by
74
// ServiceGroups.
75
public void setServerContext(ServerContext sc) {
76         this.sc = sc;
77     }
78
79     // Return the server context object.
80
public ServerContext getServerContext() {
81         return this.sc;
82     }
83
84     public String JavaDoc toString() {
85         return "[ Entry context ] ...[ " + context + " ]";
86     }
87
88 }
89
Popular Tags