protected void setupConfig(BaseMockOperationConfigType config) { Operation operation = getOperation(); if (!config.isSetName()) config.setName(operation == null ? "<missing operation>" : operation.getName()); if (!config.isSetDefaultResponse() && getMockResponseCount() > 0) setDefaultResponse(getMockResponseAt(0).getName()); if (!config.isSetDispatchStyle()) { config.setDispatchStyle(MockOperationDispatchStyleConfig.SEQUENCE); setExampleScript(); } dispatcher = MockOperationDispatchRegistry.buildDispatcher( getConfig().getDispatchStyle().toString(), this); }
public MockOperationDispatcher setDispatchStyle(String dispatchStyle) { String old = getDispatchStyle(); MockOperationDispatcher dispatcher = getDispatcher(); if (dispatcher != null && dispatchStyle.equals(old)) return dispatcher; getConfig().setDispatchStyle(MockOperationDispatchStyleConfig.Enum.forString(dispatchStyle)); if (dispatcher != null) { dispatcher.release(); } setDispatcher(MockOperationDispatchRegistry.buildDispatcher(dispatchStyle, this)); notifyPropertyChanged(DISPATCH_STYLE_PROPERTY, old, dispatchStyle); return dispatcher; }