Commit fbeb6732 authored by Vincent Pelletier's avatar Vincent Pelletier

Move conector handler retrieval code from Storage.py to app.py, to make it...

Move conector handler retrieval code from Storage.py to app.py, to make it consistent with other nodes.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@278 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 1b35133a
......@@ -26,7 +26,6 @@ from neo.client.app import Application
from neo.client.exception import NEOStorageConflictError, NEOStorageNotFoundError
from neo.event import EventManager
from neo.util import dump
from neo import connector as Connector
class Storage(BaseStorage.BaseStorage,
ConflictResolution.ConflictResolvingStorage):
......@@ -45,9 +44,7 @@ class Storage(BaseStorage.BaseStorage,
# Create dispatcher thread
dispatcher = Dispatcher(em)
dispatcher.setDaemon(True)
connector_handler = getattr(Connector, connector)
self.app = Application(master_nodes, name, em, dispatcher,
connector_handler)
self.app = Application(master_nodes, name, em, dispatcher, connector)
# Connect to primary master node
dispatcher.connectToPrimaryMasterNode(self.app, self.app.connector_handler)
# Start dispatcher
......
......@@ -35,6 +35,7 @@ from neo.client.handler import ClientEventHandler
from neo.client.exception import NEOStorageError, NEOStorageConflictError, \
NEOStorageNotFoundError
from neo.util import makeChecksum, dump
from neo import connector as Connector
from ZODB.POSException import UndoError, StorageTransactionError, ConflictError
from ZODB.utils import p64, u64, oid_repr
......@@ -179,7 +180,7 @@ class Application(object):
# Internal Attributes common to all thread
self.name = name
self.em = em
self.connector_handler = connector
self.connector_handler = getattr(Connector, connector)
self.dispatcher = dispatcher
self.nm = NodeManager()
self.cp = ConnectionPool(self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment