Search in sources :

Example 1 with ServiceType

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;
}
Also used : ServiceType(cbit.vcell.message.server.bootstrap.ServiceType)

Example 2 with ServiceType

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);
}
Also used : VCellServerID(org.vcell.util.document.VCellServerID) ServiceType(cbit.vcell.message.server.bootstrap.ServiceType) ServiceSpec(cbit.vcell.message.server.ServiceSpec) ServiceStartupType(cbit.vcell.message.server.ServiceSpec.ServiceStartupType)

Example 3 with ServiceType

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();
}
Also used : VCMessageSelector(cbit.vcell.message.VCMessageSelector) ServiceType(cbit.vcell.message.server.bootstrap.ServiceType) VCPooledQueueConsumer(cbit.vcell.message.VCPooledQueueConsumer) VCRpcMessageHandler(cbit.vcell.message.VCRpcMessageHandler) VCQueueConsumer(cbit.vcell.message.VCQueueConsumer)

Aggregations

ServiceType (cbit.vcell.message.server.bootstrap.ServiceType)3 VCMessageSelector (cbit.vcell.message.VCMessageSelector)1 VCPooledQueueConsumer (cbit.vcell.message.VCPooledQueueConsumer)1 VCQueueConsumer (cbit.vcell.message.VCQueueConsumer)1 VCRpcMessageHandler (cbit.vcell.message.VCRpcMessageHandler)1 ServiceSpec (cbit.vcell.message.server.ServiceSpec)1 ServiceStartupType (cbit.vcell.message.server.ServiceSpec.ServiceStartupType)1 VCellServerID (org.vcell.util.document.VCellServerID)1