/** * Creates a new document access using the supplied parameters. * * @param params All parameters for construction. */ public MessageBusDocumentAccess(MessageBusParams params) { super(params); this.params = params; try { com.yahoo.messagebus.MessageBusParams mbusParams = new com.yahoo.messagebus.MessageBusParams(params.getMessageBusParams()); mbusParams.addProtocol(new DocumentProtocol(getDocumentTypeManager(), params.getProtocolConfigId(), params.getLoadTypes())); if (System.getProperty("vespa.local", "false").equals("true")) { // set by Application when running locally LocalNetwork network = new LocalNetwork(); bus = new NetworkMessageBus(network, new MessageBus(network, mbusParams)); } else { bus = new RPCMessageBus(mbusParams, params.getRPCNetworkParams(), params.getRoutingConfigId()); } } catch (Exception e) { throw new DocumentAccessException(e); } }