001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.ri.sp;
017:
018: import javax.security.jacc.PolicyConfigurationFactory;
019: import javax.security.jacc.PolicyConfiguration;
020: import javax.security.jacc.PolicyContextException;
021: import java.security.PermissionCollection;
022: import java.security.Permission;
023:
024: /**
025: * @version $Rev: 602704 $ $Date: 2007-12-09 09:58:22 -0800 $
026: */
027: public class PseudoPolicyConfigurationFactory extends
028: PolicyConfigurationFactory {
029:
030: public static void install() {
031: System
032: .setProperty(
033: "javax.security.jacc.PolicyConfigurationFactory.provider",
034: PseudoPolicyConfigurationFactory.class
035: .getName());
036: }
037:
038: public PolicyConfiguration getPolicyConfiguration(
039: final String contextID, boolean remove)
040: throws PolicyContextException {
041: return new PolicyConfiguration() {
042: public String getContextID() throws PolicyContextException {
043: return contextID;
044: }
045:
046: public void addToRole(String roleName,
047: PermissionCollection permissions)
048: throws PolicyContextException {
049: }
050:
051: public void addToRole(String roleName, Permission permission)
052: throws PolicyContextException {
053: }
054:
055: public void addToUncheckedPolicy(
056: PermissionCollection permissions)
057: throws PolicyContextException {
058: }
059:
060: public void addToUncheckedPolicy(Permission permission)
061: throws PolicyContextException {
062: }
063:
064: public void addToExcludedPolicy(
065: PermissionCollection permissions)
066: throws PolicyContextException {
067: }
068:
069: public void addToExcludedPolicy(Permission permission)
070: throws PolicyContextException {
071: }
072:
073: public void removeRole(String roleName)
074: throws PolicyContextException {
075: }
076:
077: public void removeUncheckedPolicy()
078: throws PolicyContextException {
079: }
080:
081: public void removeExcludedPolicy()
082: throws PolicyContextException {
083: }
084:
085: public void linkConfiguration(PolicyConfiguration link)
086: throws PolicyContextException {
087: }
088:
089: public void delete() throws PolicyContextException {
090: }
091:
092: public void commit() throws PolicyContextException {
093: }
094:
095: public boolean inService() throws PolicyContextException {
096: return false;
097: }
098: };
099: }
100:
101: public boolean inService(String contextID)
102: throws PolicyContextException {
103: return true;
104: }
105: }
|