01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.geronimo.corba.security;
17:
18: import java.io.Serializable;
19:
20: import org.omg.CORBA.LocalObject;
21: import org.omg.CORBA.Policy;
22:
23: import org.apache.geronimo.corba.security.config.tss.TSSConfig;
24:
25: /**
26: * @version $Rev: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
27: */
28: public class ServerPolicy extends LocalObject implements Policy {
29:
30: private final TSSConfig TSSConfig;
31: private final ClassLoader classloader;
32:
33: public ServerPolicy(Config config) {
34: this .TSSConfig = config.getTSSConfig();
35: this .classloader = config.getClassloader();
36: }
37:
38: protected ServerPolicy(TSSConfig config, ClassLoader classLoader) {
39: this .TSSConfig = config;
40: this .classloader = classLoader;
41: }
42:
43: public TSSConfig getConfig() {
44: return TSSConfig;
45: }
46:
47: public ClassLoader getClassloader() {
48: return classloader;
49: }
50:
51: public int policy_type() {
52: return ServerPolicyFactory.POLICY_TYPE;
53: }
54:
55: public void destroy() {
56: }
57:
58: public Policy copy() {
59: return new ServerPolicy(TSSConfig, classloader);
60: }
61:
62: public static class Config implements Serializable {
63: private final TSSConfig TSSConfig;
64: private final transient ClassLoader classloader;
65:
66: public Config(TSSConfig TSSConfig, ClassLoader classloader) {
67: this .TSSConfig = TSSConfig;
68: this .classloader = classloader;
69: }
70:
71: public final TSSConfig getTSSConfig() {
72: return TSSConfig;
73: }
74:
75: public final ClassLoader getClassloader() {
76: return classloader;
77: }
78: }
79: }
|