use of cbit.vcell.message.server.bootstrap.ServiceType in project vcell by virtualcell.
the class AddNewServiceDialog method getTypeCombo.
private javax.swing.JComboBox getTypeCombo() {
if (ivjTypeCombo == null) {
try {
ivjTypeCombo = new javax.swing.JComboBox();
for (ServiceType st : ServiceType.values()) {
if (!st.equals(ServiceType.SERVERMANAGER)) {
ivjTypeCombo.addItem(st);
}
}
ivjTypeCombo.setSelectedIndex(-1);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjTypeCombo;
}
use of cbit.vcell.message.server.bootstrap.ServiceType in project vcell by virtualcell.
the class AddNewServiceDialog method getServiceSpec.
/**
* Insert the method's description here.
* Creation date: (8/22/2003 4:07:31 PM)
* @return cbit.vcell.messaging.admin.VCellServiceConfig
*/
public ServiceSpec getServiceSpec() {
VCellServerID site = VCellServerID.getServerID(getSiteField().getText());
ServiceType stype = (ServiceType) getTypeCombo().getSelectedItem();
int ordinal = 0;
try {
ordinal = Integer.parseInt("" + getOrdinalCombo().getSelectedItem());
} catch (NumberFormatException ex) {
throw new RuntimeException("Ordinal must be a number!");
}
ServiceStartupType startup = ServiceStartupType.fromDescription((String) getStartupCombo().getSelectedItem());
int memoryMB = Integer.parseInt(getMemoryMBField().getText());
return new ServiceSpec(site, stype, ordinal, startup, memoryMB);
}
use of cbit.vcell.message.server.bootstrap.ServiceType in project vcell by virtualcell.
the class SimDataServer method init.
public void init() throws Exception {
String dataRequestFilter = "(" + VCMessagingConstants.MESSAGE_TYPE_PROPERTY + "='" + VCMessagingConstants.MESSAGE_TYPE_RPC_SERVICE_VALUE + "') " + " AND (" + VCMessagingConstants.SERVICE_TYPE_PROPERTY + "='" + ServiceType.DATA.getName() + "')";
String exportOnlyFilter = "(" + ServiceType.DATAEXPORT.getName() + " is NOT NULL)";
String dataOnlyFilter = "(" + ServiceType.DATAEXPORT.getName() + " is NULL)";
VCMessageSelector selector;
ServiceType serviceType = serviceInstanceStatus.getType();
int numThreads;
if (serviceType == ServiceType.DATAEXPORT) {
selector = vcMessagingService.createSelector(dataRequestFilter + " AND " + exportOnlyFilter);
numThreads = Integer.parseInt(PropertyLoader.getProperty(PropertyLoader.exportdataThreadsProperty, "3"));
} else if (serviceType == ServiceType.DATA) {
selector = vcMessagingService.createSelector(dataRequestFilter + " AND " + dataOnlyFilter);
numThreads = Integer.parseInt(PropertyLoader.getProperty(PropertyLoader.simdataThreadsProperty, "5"));
} else {
throw new RuntimeException("expecting either Service type of " + ServiceType.DATA + " or " + ServiceType.DATAEXPORT);
}
this.sharedProducerSession = vcMessagingService.createProducerSession();
rpcMessageHandler = new VCRpcMessageHandler(dataServerImpl, VCellQueue.DataRequestQueue);
this.pooledQueueConsumer = new VCPooledQueueConsumer(rpcMessageHandler, numThreads, sharedProducerSession);
this.pooledQueueConsumer.initThreadPool();
rpcConsumer = new VCQueueConsumer(VCellQueue.DataRequestQueue, pooledQueueConsumer, selector, serviceType.getName() + " RPC Server Thread", MessageConstants.PREFETCH_LIMIT_DATA_REQUEST);
vcMessagingService.addMessageConsumer(rpcConsumer);
initControlTopicListener();
}
Aggregations