Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rubendel committed Feb 20, 2015
2 parents 36e856e + 803b385 commit 9ac57db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions BimServer/src/org/bimserver/BimServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,10 @@ private void initDatabaseDependantItems() throws BimserverDatabaseException {
ses.close();
}

if (getServerSettingsCache().getServerSettings().getProtocolBuffersPort() != -1) {
Integer protocolBuffersPort = getServerSettingsCache().getServerSettings().getProtocolBuffersPort();
if (protocolBuffersPort >= 1 && protocolBuffersPort <= 65535) {
try {
protocolBuffersServer = new ProtocolBuffersServer(protocolBuffersMetaData, serviceFactory, servicesMap, config.getInitialProtocolBuffersPort());
protocolBuffersServer = new ProtocolBuffersServer(protocolBuffersMetaData, serviceFactory, servicesMap, protocolBuffersPort);
protocolBuffersServer.start();
} catch (Exception e) {
LOGGER.error("", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import org.bimserver.models.log.AccessMethod;
import org.bimserver.shared.exceptions.UserException;
import org.bimserver.shared.interfaces.ServiceInterface;
import org.bimserver.shared.interfaces.PublicInterface;
import org.bimserver.shared.meta.SMethod;
import org.bimserver.shared.meta.SService;
import org.bimserver.shared.meta.SServicesMap;
Expand Down Expand Up @@ -84,14 +84,15 @@ public void run() {
throw new UserException("Method " + methodName + " not found on " + serviceName);
}

ServiceInterface service = null;
Class<? extends PublicInterface> clazz = sService.getInterfaceClass();
PublicInterface service = null;
if (token.equals("")) {
service = serviceFactory.get(AccessMethod.PROTOCOL_BUFFERS).get(ServiceInterface.class);
service = serviceFactory.get(AccessMethod.PROTOCOL_BUFFERS).get(clazz);
} else {
service = serviceFactory.get(token, AccessMethod.PROTOCOL_BUFFERS).get(ServiceInterface.class);
service = serviceFactory.get(token, AccessMethod.PROTOCOL_BUFFERS).get(clazz);
}

ReflectiveRpcChannel reflectiveRpcChannel = new ReflectiveRpcChannel(ServiceInterface.class, service, protocolBuffersMetaData, servicesMap);
ReflectiveRpcChannel reflectiveRpcChannel = new ReflectiveRpcChannel(clazz, service, protocolBuffersMetaData, servicesMap);
MethodDescriptorContainer pbMethod = protocolBuffersMetaData.getMethod(serviceName, methodName);
Builder requestBuilder = DynamicMessage.getDefaultInstance(pbMethod.getInputDescriptor()).newBuilderForType();
requestBuilder.mergeDelimitedFrom(dataInputStream);
Expand Down

0 comments on commit 9ac57db

Please sign in to comment.