Exemple #1
0
    def do_unload(self, pkg):
        for n in pkg.__dict__.keys():
            e = pkg.__dict__[n]
            if isinstance(e, PyJavaClass):
                if _is_lazy(e): continue
                if e.classLoader is self.loader:
                    del pkg.__dict__[n]
                    if pkg.__name__:
                        n = self.ls_name + '.' + pkg.__name__ + '.' + n
                    else:
                        n = self.ls_name + '.' + n
                    if sys.modules.has_key(n): del sys.modules[n]

            elif isinstance(e, PyJavaPackage):
                self.do_unload(e)
Exemple #2
0
    def do_unload(self, pkg):
        for n in pkg.__dict__.keys():
            e = pkg.__dict__[n]
            if isinstance(e, PyJavaClass):
                if _is_lazy(e):
                    continue
                if e.classLoader is self.loader:
                    del pkg.__dict__[n]
                    if pkg.__name__:
                        n = self.ls_name + "." + pkg.__name__ + "." + n
                    else:
                        n = self.ls_name + "." + n
                    if sys.modules.has_key(n):
                        del sys.modules[n]

            elif isinstance(e, PyJavaPackage):
                self.do_unload(e)
Exemple #3
0
def _do_reload(ls_name, mgr, pkg):
    pkg_name = pkg.__name__
    for n in pkg.__dict__.keys():
        e = pkg.__dict__[n]
        if isinstance(e, PyJavaClass):
            if _is_lazy(e): continue
            del pkg.__dict__[n]
            try:
                c = mgr.findClass(pkg_name, n)
                if c:
                    pkg.__dict__[n] = c
                    if pkg_name:
                        n = ls_name + '.' + pkg_name + '.' + n
                    else:
                        n = ls_name + '.' + n
                    if sys.modules.has_key(n): sys.modules[n] = c
            except:
                pass
        elif isinstance(e, PyJavaPackage):
            _do_reload(ls_name, mgr, e)
Exemple #4
0
def _do_reload(ls_name, mgr, pkg):
    pkg_name = pkg.__name__
    for n in pkg.__dict__.keys():
        e = pkg.__dict__[n]
        if isinstance(e, PyJavaClass):
            if _is_lazy(e):
                continue
            del pkg.__dict__[n]
            try:
                c = mgr.findClass(pkg_name, n)
                if c:
                    pkg.__dict__[n] = c
                    if pkg_name:
                        n = ls_name + "." + pkg_name + "." + n
                    else:
                        n = ls_name + "." + n
                    if sys.modules.has_key(n):
                        sys.modules[n] = c
            except:
                pass
        elif isinstance(e, PyJavaPackage):
            _do_reload(ls_name, mgr, e)