/******************************************************************************* | |
* Copyright (c) 2009 IBM Corporation. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* IBM Corporation - initial API and implementation | |
******************************************************************************/ | |
package org.eclipse.ptp.rm.pbs.core.rmsystem; | |
import java.util.Collection; | |
import org.eclipse.ptp.core.attributes.AttributeManager; | |
import org.eclipse.ptp.core.elementcontrols.IPJobControl; | |
import org.eclipse.ptp.core.elementcontrols.IPMachineControl; | |
import org.eclipse.ptp.core.elementcontrols.IPNodeControl; | |
import org.eclipse.ptp.core.elementcontrols.IPProcessControl; | |
import org.eclipse.ptp.core.elementcontrols.IPQueueControl; | |
import org.eclipse.ptp.core.elementcontrols.IPUniverseControl; | |
import org.eclipse.ptp.rm.pbs.core.rtsystem.PBSProxyRuntimeClient; | |
import org.eclipse.ptp.rm.pbs.core.rtsystem.PBSRuntimeSystem; | |
import org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager; | |
import org.eclipse.ptp.rmsystem.IResourceManagerConfiguration; | |
import org.eclipse.ptp.rtsystem.IRuntimeSystem; | |
public class PBSResourceManager extends AbstractRuntimeResourceManager { | |
private Integer PBSRMID; | |
public PBSResourceManager(Integer id, IPUniverseControl universe, IResourceManagerConfiguration config) { | |
super(id.toString(), universe, config); | |
PBSRMID = id; | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractProxyResourceManager#doAfterCloseConnection() | |
*/ | |
protected void doAfterCloseConnection() { | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractProxyResourceManager#doAfterOpenConnection() | |
*/ | |
protected void doAfterOpenConnection() { | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractProxyResourceManager#doBeforeCloseConnection() | |
*/ | |
protected void doBeforeCloseConnection() { | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractProxyResourceManager#doBeforeOpenConnection() | |
*/ | |
protected void doBeforeOpenConnection() { | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doCreateJob(org.eclipse.ptp.core.elementcontrols.IPQueueControl, java.lang.String, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected IPJobControl doCreateJob(IPQueueControl queue, String jobId, AttributeManager attrs) { | |
return newJob(queue, jobId, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doCreateMachine(java.lang.String, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected IPMachineControl doCreateMachine(String machineId, AttributeManager attrs) { | |
return newMachine(machineId, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doCreateNode(org.eclipse.ptp.core.elementcontrols.IPMachineControl, java.lang.String, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected IPNodeControl doCreateNode(IPMachineControl machine, String nodeId, AttributeManager attrs) { | |
return newNode(machine, nodeId, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doCreateProcess(org.eclipse.ptp.core.elementcontrols.IPJobControl, java.lang.String, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected IPProcessControl doCreateProcess(IPJobControl job, String processId, AttributeManager attrs) { | |
return newProcess(job, processId, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doCreateQueue(java.lang.String, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected IPQueueControl doCreateQueue(String queueId, AttributeManager attrs) { | |
return newQueue(queueId, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doCreateRuntimeSystem() | |
*/ | |
@Override | |
protected IRuntimeSystem doCreateRuntimeSystem() { | |
IPBSResourceManagerConfiguration config = (IPBSResourceManagerConfiguration) getConfiguration(); | |
/* load up the control and monitoring systems for PBS */ | |
PBSProxyRuntimeClient runtimeProxy = new PBSProxyRuntimeClient(config, PBSRMID); | |
return new PBSRuntimeSystem(runtimeProxy, getAttributeDefinitionManager()); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doUpdateJobs(org.eclipse.ptp.core.elements.IPQueue, java.util.Collection, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected boolean doUpdateJobs(IPQueueControl queue, Collection<IPJobControl> jobs, | |
AttributeManager attrs) { | |
return updateJobs(queue, jobs, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doUpdateMachines(java.util.Collection, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected boolean doUpdateMachines(Collection<IPMachineControl> machines, | |
AttributeManager attrs) { | |
return updateMachines(machines, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doUpdateNodes(org.eclipse.ptp.core.elementcontrols.IPMachineControl, java.util.Collection, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected boolean doUpdateNodes(IPMachineControl machine, | |
Collection<IPNodeControl> nodes, AttributeManager attrs) { | |
return updateNodes(machine, nodes, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doUpdateProcesses(org.eclipse.ptp.core.elementcontrols.IPJobControl, java.util.Collection, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected boolean doUpdateProcesses(IPJobControl job, | |
Collection<IPProcessControl> processes, AttributeManager attrs) { | |
return updateProcesses(job, processes, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doUpdateQueues(java.util.Collection, org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected boolean doUpdateQueues(Collection<IPQueueControl> queues, | |
AttributeManager attrs) { | |
return updateQueues(queues, attrs); | |
} | |
/* (non-Javadoc) | |
* @see org.eclipse.ptp.rmsystem.AbstractRuntimeResourceManager#doUpdateRM(org.eclipse.ptp.core.attributes.AttributeManager) | |
*/ | |
@Override | |
protected boolean doUpdateRM(AttributeManager attrs) { | |
return updateRM(attrs); | |
} | |
} |