public class AbstractJobCenter extends Object implements JobCenter
DEFAULT_PORT
Constructor and Description |
---|
AbstractJobCenter() |
Modifier and Type | Method and Description |
---|---|
void |
autoMatch()
自动进行匹配,如果有匹配成功的,则予以触发执行
|
Warehouse |
doWork(Work work)
执行一项工作,期望同步得到结果或异常 如果没有合适的工人或包工头进行处理,马上会抛出异常
|
List<Foreman> |
getForeman(String type)
返回组织某种工作的的空闲工头列表
|
RmiServer |
getRmiServer() |
List<Worker> |
getWorkerList(Work work)
返回具有某种类型的空闲且愿意接受工作的工人列表
|
List<Work> |
getWorkList()
返回所有的工作列表
|
List<Work> |
getWorkList(String type,
WorkStatus workStatus)
返回某种类型的某种状态的工作列表
|
WorkQueue |
getWorkQueue()
返回工作队列对象
|
WorkStatus |
getWorkStatus(Work work)
返回指定工作的工作状态
|
void |
registerForeman(Foreman foreman)
注册包工头
|
void |
registerWork(Work work)
注册一份工作,工作情况不需要马上关注。因此也就不用等待,马上返回可以进行其它处理
如果有返回结果,可以通过异步方式,,异步方式可以用后续工作的方式来指定
|
void |
registerWorker(Worker worker)
注册工人
|
void |
replaceWork(Work oldWork,
Work newWork) |
void |
setRmiServer(RmiServer rmiServer) |
void |
setWorkQueue(WorkQueue workQueue) |
void |
stop()
职业介绍所关门
|
void |
unregisterForeMan(Foreman foreman)
注销包工头
|
void |
unregisterWork(Work work)
取消工作,在工作没有分配出去之前,可以从职介所注消工作,如果工作已经分配出去,则无法注消
|
void |
unregisterWorker(Worker worker)
注消工人
|
public WorkQueue getWorkQueue()
JobCenter
getWorkQueue
in interface JobCenter
public void setWorkQueue(WorkQueue workQueue)
public RmiServer getRmiServer()
getRmiServer
in interface JobCenter
public void setRmiServer(RmiServer rmiServer) throws RemoteException
setRmiServer
in interface JobCenter
RemoteException
public void registerWorker(Worker worker) throws RemoteException
JobCenter
registerWorker
in interface JobCenter
RemoteException
public void unregisterWorker(Worker worker) throws RemoteException
JobCenter
unregisterWorker
in interface JobCenter
RemoteException
public void registerWork(Work work) throws IOException
JobCenter
registerWork
in interface JobCenter
IOException
public void replaceWork(Work oldWork, Work newWork) throws RemoteException
RemoteException
public void unregisterWork(Work work) throws RemoteException
JobCenter
unregisterWork
in interface JobCenter
RemoteException
public WorkStatus getWorkStatus(Work work) throws RemoteException
JobCenter
getWorkStatus
in interface JobCenter
RemoteException
public void registerForeman(Foreman foreman) throws RemoteException
JobCenter
registerForeman
in interface JobCenter
RemoteException
public void unregisterForeMan(Foreman foreman) throws RemoteException
JobCenter
unregisterForeMan
in interface JobCenter
RemoteException
public List<Worker> getWorkerList(Work work) throws RemoteException
JobCenter
getWorkerList
in interface JobCenter
RemoteException
public List<Work> getWorkList() throws RemoteException
JobCenter
getWorkList
in interface JobCenter
RemoteException
public List<Work> getWorkList(String type, WorkStatus workStatus) throws RemoteException
JobCenter
getWorkList
in interface JobCenter
RemoteException
public List<Foreman> getForeman(String type) throws RemoteException
JobCenter
getForeman
in interface JobCenter
RemoteException
public Warehouse doWork(Work work) throws IOException
JobCenter
doWork
in interface JobCenter
IOException
public void autoMatch() throws IOException
JobCenter
autoMatch
in interface JobCenter
IOException
public void stop() throws RemoteException
JobCenter
stop
in interface JobCenter
RemoteException
Copyright © 2006–2018 TinyGroup. All rights reserved.