|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.container.imp.AbstractParseListener net.sf.container.imp.AbstractPolicyFactory net.sf.container.imp.CodebaseFactory
public class CodebaseFactory
Container factory providing Container
creation where
container policies are based on "codeBase" identification.
The factory is instantiated with list of policies and consequent
container instantiations are resolved by looking up
java.security.CodeSource.getLocation()
for matching
permission sets.
Example:
created on Jun 10, 2005
if the policy file contains:
grant codeBase "file://no.domain/sandbox" {
permission java.util.PropertyPermission "java.version", "read";
};
grant codeBase "file://${java.home}/no.domain/trusted" {
permission java.util.PropertyPermission "java.path", "read";
permission java.util.PropertyPermission "java.version", "read";
};
containerFactory.newContainer("file://no.domain/sandbox") would
result in sandbox permissions set.
containerFactory.newContainer("file://no.domain/trusted") would
result in trusted permissions set.
containerFactory.newContainer(null) would
result in no permissions as there wasn't any default permissions set defined.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.container.imp.AbstractParseListener |
---|
AbstractParseListener.GrantEntry |
Constructor Summary | |
---|---|
CodebaseFactory()
instantiate a factory with policies defined in the policy file |
|
CodebaseFactory(java.net.URL policyFile)
instantiate a factory with policies defined in the policy file |
|
CodebaseFactory(java.net.URL policyFile,
PolicyParser parser)
instantiate a factory with policies defined in the policy file |
Method Summary | |
---|---|
ContainerFactory |
getContainerFactory()
|
Container |
newContainer(java.lang.Object permissionsCriteria)
create new container based on codeBase permission set criteria |
Container |
newContainer(java.lang.String codeBase)
create new container based on the url it is supposed that there is only one policy "codeBase" matching to that URL. |
Methods inherited from class net.sf.container.imp.AbstractPolicyFactory |
---|
newContainer, setPolicies, setPolicies |
Methods inherited from class net.sf.container.imp.AbstractParseListener |
---|
beginParsing, endGrant, endParsing, endPolicyFile, getAllKeyStores, getAllPolicies, getKeyStores, getProtectionDomains, lookupCertificate, lookupCertificatesList, newGrant, newKeystore, newPermission, newPolicyFile, newUrlInputSteam, parseEnvVars, replaceCurrentUrlPosition, resolveKsInputSteam, spreadDefaultGrants, toExternalForm |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CodebaseFactory()
AbstractPolicyFactory.AbstractPolicyFactory()
public CodebaseFactory(java.net.URL policyFile) throws java.io.FileNotFoundException, PolicyParseException, java.io.IOException
policyFile
-
java.io.FileNotFoundException
PolicyParseException
java.io.IOException
AbstractPolicyFactory.AbstractPolicyFactory(URL)
public CodebaseFactory(java.net.URL policyFile, PolicyParser parser) throws java.io.FileNotFoundException, PolicyParseException, java.io.IOException
policyFile
- parser
-
java.io.FileNotFoundException
PolicyParseException
java.io.IOException
AbstractPolicyFactory.AbstractPolicyFactory(URL,PolicyParser)
Method Detail |
---|
public ContainerFactory getContainerFactory()
public Container newContainer(java.lang.Object permissionsCriteria)
permissionsCriteria
-
Container
objectpublic Container newContainer(java.lang.String codeBase)
it is supposed that there is only one policy "codeBase" matching to that URL.
If "codeBase" is null, default permissions set is added.
If no default permissions set exists then the Container
is created with no permissions at all.
Examples: "file://no.domain/sandbox", "file://${java.home}/no.domain/trusted", null
codeBase
-
Container
object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |