コード例 #1
0
ファイル: manager.py プロジェクト: arritrancos/chimera
    def __init__(self, host=None, port=None):
        RemoteObject.__init__(self)

        log.info("Starting manager.")

        self.resources = ResourcesManager()
        self.classLoader = ClassLoader()

        # identity
        self.setGUID(MANAGER_LOCATION)

        # shutdown event
        self.died = threading.Event()

        # our daemon server
        self.adapter = ManagerAdapter(self, host, port)
        self.adapterThread = threading.Thread(target=self.adapter.requestLoop)
        self.adapterThread.setDaemon(True)
        self.adapterThread.start()

        # register ourselves
        self.resources.add(
            MANAGER_LOCATION,
            self,
            getManagerURI(self.getHostname(),
                          self.getPort()))
コード例 #2
0
    def __init__(self, filename, fd):
        RemoteObject.__init__(self)

        self._fd = fd
        self._filename = filename
        self._http = None
        self._wcs = None
コード例 #3
0
ファイル: image.py プロジェクト: arritrancos/chimera
    def __init__(self, filename, fd):
        RemoteObject.__init__(self)

        self._fd = fd
        self._filename = filename
        self._http = None
        self._wcs = None
コード例 #4
0
    def __init__(self):
        RemoteObject.__init__(self)

        # event handling
        self.__events_proxy__ = EventsProxy()

        # configuration handling
        self.__config_proxy__ = Config(self)

        self.__state__ = State.STOPPED

        self.__location__ = ""

        # logging.
        # put every logger on behalf of chimera's logger so
        # we can easily setup levels on all our parts
        logName = self.__module__
        if not logName.startswith("chimera."):
            logName = "chimera." + logName + " (%s)" % logName

        self.log = logging.getLogger(logName)

        # Hz
        self._Hz = 2
        self._loop_abort = threading.Event()
コード例 #5
0
ファイル: chimeraobject.py プロジェクト: rayshifu/chimera
    def __init__(self):
        RemoteObject.__init__(self)

        # event handling
        self.__events_proxy__ = EventsProxy()

        # configuration handling
        self.__config_proxy__ = Config(self)

        self.__state__ = State.STOPPED

        self.__location__ = ""

        # logging.
        # put every logger on behalf of chimera's logger so
        # we can easily setup levels on all our parts
        logName = self.__module__
        if not logName.startswith("chimera."):
            logName = "chimera." + logName + " (%s)" % logName

        self.log = logging.getLogger(logName)

        # Hz
        self._Hz = 2
        self._loop_abort = threading.Event()

        # To override metadata default values
        self.__metadataOverrideMethod__ = None
コード例 #6
0
    def __init__(self, host=None, port=None, local=False):
        RemoteObject.__init__(self)

        log.info("Starting manager.")

        self.resources = ResourcesManager()
        self.classLoader = ClassLoader()

        # identity
        self.setGUID(MANAGER_LOCATION)

        # shutdown event
        self.died = threading.Event()

        if not local:
            try:
                ManagerLocator.locate()
                raise ChimeraException("Chimera is already running"
                                       " on this system. Use chimera-admin"
                                       " to manage it.")
            except ManagerNotFoundException:
                # ok, we are alone.
                pass

        # our daemon server
        self.adapter = ManagerAdapter(self, host, port)
        self.adapterThread = threading.Thread(target=self.adapter.requestLoop)
        self.adapterThread.setDaemon(True)
        self.adapterThread.start()

        # finder beacon
        if not local:
            self.beacon = ManagerBeacon(self)
            self.beaconThread = threading.Thread(target=self.beacon.run)
            self.beaconThread.setDaemon(True)
            self.beaconThread.start()
        else:
            self.beacon = None

        # register ourself
        self.resources.add(MANAGER_LOCATION, self,
                           getManagerURI(self.getHostname(), self.getPort()))

        # signals
        signal.signal(signal.SIGTERM, self._sighandler)
        signal.signal(signal.SIGINT, self._sighandler)
        atexit.register(self._sighandler)
コード例 #7
0
ファイル: manager.py プロジェクト: phsilva/chimera
    def __init__(self, host=None, port=None):
        RemoteObject.__init__(self)

        log.info("Starting manager.")

        self.resources = ResourcesManager()
        self.classLoader = ClassLoader()

        # identity
        self.setGUID(MANAGER_LOCATION)

        # shutdown event
        self.died = threading.Event()

        # our daemon server
        self.adapter = ManagerAdapter(self, host, port)
        self.adapterThread = threading.Thread(target=self.adapter.requestLoop)
        self.adapterThread.setDaemon(True)
        self.adapterThread.start()

        # register ourself
        self.resources.add(MANAGER_LOCATION, self,
                           getManagerURI(self.getHostname(), self.getPort()))