paul@90 | 1 | #!/usr/bin/env python |
paul@90 | 2 | |
paul@115 | 3 | import java.lang |
paul@115 | 4 | |
paul@115 | 5 | class AccessControlContext(java.lang.Object): |
paul@90 | 6 | def __init__(self): |
paul@90 | 7 | # NOTE: Python-only method. |
paul@90 | 8 | self.acc = None |
paul@90 | 9 | self.combiner = None |
paul@90 | 10 | self.context = None |
paul@90 | 11 | def init__acc_combiner(self, acc, combiner): |
paul@90 | 12 | self.acc = acc |
paul@90 | 13 | self.combiner = combiner |
paul@90 | 14 | self.context = None |
paul@90 | 15 | def init__context(self, context): |
paul@90 | 16 | self.acc = None |
paul@90 | 17 | self.combiner = None |
paul@90 | 18 | self.context = context |
paul@90 | 19 | def checkPermission(self, perm): |
paul@90 | 20 | # NOTE: Implement properly. |
paul@90 | 21 | pass |
paul@90 | 22 | checkPermission___java__security__Permission = checkPermission |
paul@90 | 23 | def equals(self, obj): |
paul@90 | 24 | return self.context == obj.context |
paul@90 | 25 | equals___java__lang__Object = equals |
paul@90 | 26 | def getDomainCombiner(self): |
paul@90 | 27 | return self.combiner |
paul@90 | 28 | getDomainCombiner___java__security__DomainCombiner = getDomainCombiner |
paul@90 | 29 | def hashCode(self): |
paul@90 | 30 | # NOTE: Using Python hash function. |
paul@90 | 31 | return hash(self) |
paul@90 | 32 | hashCode___ = hashCode |
paul@90 | 33 | |
paul@90 | 34 | setattr(AccessControlContext, "__init_____java__security__AccessControlContext___java__security__DomainCombiner", |
paul@90 | 35 | AccessControlContext.init__acc_combiner) |
paul@90 | 36 | setattr(AccessControlContext, "__init_____java__security__ProtectionDomain_array_", AccessControlContext.init__context) |
paul@90 | 37 | |
paul@115 | 38 | class AccessController(java.lang.Object): |
paul@90 | 39 | def checkPermission(perm): |
paul@90 | 40 | # NOTE: Implement properly. |
paul@90 | 41 | pass |
paul@90 | 42 | checkPermission___java__security__Permission = staticmethod(checkPermission) |
paul@90 | 43 | def doPrivileged(action, context=None): |
paul@90 | 44 | # NOTE: Implement properly. |
paul@90 | 45 | return action.run___() |
paul@90 | 46 | doPrivileged___java__security__PrivilegedAction = staticmethod(doPrivileged) |
paul@90 | 47 | doPrivileged___java__security__PrivilegedAction___java__security__AccessControlContext = staticmethod(doPrivileged) |
paul@90 | 48 | def getContext(): |
paul@90 | 49 | # NOTE: Implement properly. |
paul@90 | 50 | return AccessControlContext() |
paul@90 | 51 | |
paul@163 | 52 | class SecureClassLoader(java.lang.ClassLoader): |
paul@163 | 53 | pass |
paul@163 | 54 | |
paul@90 | 55 | # vim: tabstop=4 expandtab shiftwidth=4 |