public static <VERTICLE extends Verticle> boolean blockDeploy(Vertx vertx, Class<VERTICLE> cls, DeploymentOptions options) throws InterruptedException { Holder<Boolean> result = new Holder<>(); CountDownLatch latch = new CountDownLatch(1); vertx.deployVerticle(cls.getName(), options, ar -> { result.value = ar.succeeded(); if (ar.failed()) { LOGGER.error("deploy vertx failed, cause ", ar.cause()); } latch.countDown(); }); latch.await(); return result.value; }
private Holder<Boolean> checkQpsFlowControl(OperationMeta operationMeta) { Holder<Boolean> qpsFlowControlReject = new Holder<>(false); @SuppressWarnings("deprecation") Handler providerQpsFlowControlHandler = operationMeta.getProviderQpsFlowControlHandler(); if (null != providerQpsFlowControlHandler) { try { providerQpsFlowControlHandler.handle(invocation, response -> { qpsFlowControlReject.value = true; produceProcessor = ProduceProcessorManager.JSON_PROCESSOR; sendResponse(response); }); } catch (Exception e) { LOGGER.error("failed to execute ProviderQpsFlowControlHandler", e); qpsFlowControlReject.value = true; sendFailResponse(e); } } return qpsFlowControlReject; }
private Holder<Boolean> checkQpsFlowControl(OperationMeta operationMeta) { Holder<Boolean> qpsFlowControlReject = new Holder<>(false); @SuppressWarnings("deprecation") Handler providerQpsFlowControlHandler = operationMeta.getProviderQpsFlowControlHandler(); if (null != providerQpsFlowControlHandler) { try { providerQpsFlowControlHandler.handle(invocation, response -> { qpsFlowControlReject.value = true; sendResponse(header.getContext(), response); }); } catch (Exception e) { LOGGER.error("failed to execute ProviderQpsFlowControlHandler", e); qpsFlowControlReject.value = true; sendResponse(header.getContext(), Response.providerFailResp(e)); } } return qpsFlowControlReject; } }
@Override void put(Object obj, Object[] args) { Holder holder = new Holder(); if (obj != null) { holder.value = obj; } args[idx] = holder; } }
@Override void put(Object obj, Object[] args) { Holder holder = new Holder(); if (obj != null) { holder.value = obj; } args[idx] = holder; } }
Holder<T> holder = new Holder<>(obj); opName = calculateOpName(holder, opName, hasOpName);
/** * @param accounting * Object that looks after how many runs are executing. * @throws RemoteException */ public WorkerCore(@Nonnull RunAccounting accounting) throws RemoteException { super(); stdout = new StringWriter(); stderr = new StringWriter(); pid = new Holder<>(); this.accounting = accounting; }
Holder<T> holder = new Holder<>(obj); opName = calculateOpName(holder, opName, hasOpName);
/** * Converts a binding extension into a Web Services extension holder. */ public static javax.xml.ws.Holder<CmisExtensionType> convertExtensionHolder(ExtensionsData extension) { if (extension == null) { return null; } javax.xml.ws.Holder<CmisExtensionType> result = new javax.xml.ws.Holder<CmisExtensionType>(); result.value = convert(extension); return result; }
@Override public ConceptName createConceptName(String name, boolean isPreferred) { try { soapGraph.createConceptName(graphId, id, new Holder<String>(name), Boolean.valueOf(isPreferred)); return new SOAPConceptName(parent, id, name); } catch (WebserviceException_Exception e) { parent.fireActionEvent(e, e.getMessage()); e.printStackTrace(); } return null; }
@Test public void testWrappedHolderOutNull() throws Exception { // this test to verify CXF-3836 works QName portName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", "DocLitWrappedCodeFirstServicePort"); QName servName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", "DocLitWrappedCodeFirstService"); Service service = Service.create(new URL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl"), servName); DocLitWrappedCodeFirstService port = service.getPort(portName, DocLitWrappedCodeFirstService.class); Holder<Boolean> created = new Holder<>(); port.singleInOut(created); assertEquals(created.value, Boolean.FALSE); }
@Override public DataSource createDataSource(String id, String fullname, String description) { try { soapGraph.createDataSource(graphId, new Holder<String>(id), fullname, description); return new SOAPDataSource(parent, id); } catch (WebserviceException_Exception e) { parent.fireActionEvent(e, e.getMessage()); e.printStackTrace(); } return null; }
@Test public void testEchoWithLowThreshold() throws Exception { ByteArrayOutputStream bout = this.setupOutLogging(); byte[] bytes = ImageHelper.getImageBytes(getImage("/java.jpg"), "image/jpeg"); Holder<byte[]> image = new Holder<>(bytes); Hello hello = this.getPort(500); hello.echoData(image); assertTrue("MTOM should be enabled", bout.toString().indexOf("<xop:Include") > -1); }
@Test public void testEchoWithHighThreshold() throws Exception { ByteArrayOutputStream bout = this.setupOutLogging(); byte[] bytes = ImageHelper.getImageBytes(getImage("/java.jpg"), "image/jpeg"); Holder<byte[]> image = new Holder<>(bytes); Hello hello = this.getPort(2000); hello.echoData(image); assertTrue("MTOM should not be enabled", bout.toString().indexOf("<xop:Include") == -1); }
@Override public PublisherAssertions setPublisherAssertions(SetPublisherAssertions body) throws org.uddi.v2_service.DispositionReport { try { Holder<List<PublisherAssertion>> req = new Holder<List<PublisherAssertion>>(); req.value = MapUDDIv2Tov3.MapSetPublisherAssertions(body); publishService.setPublisherAssertions(body.getAuthInfo(), req); return MapUDDIv3Tov2.MapPublisherAssertions(req.value, getNodeID(), getUsername(body.getAuthInfo())); } catch (DispositionReportFaultMessage ex) { throw MapUDDIv3Tov2.MapException(ex, getNodeID()); } }
@Test public void testEcho() throws Exception { byte[] bytes = ImageHelper.getImageBytes(getImage("/java.jpg"), "image/jpeg"); Holder<byte[]> image = new Holder<>(bytes); port.echoData(image); assertNotNull(image); }
private void doTestGetBookAsync(String address, boolean asyncInvoker) throws InterruptedException, ExecutionException { WebClient wc = createWebClient(address); final Holder<Book> holder = new Holder<>(); InvocationCallback<Book> callback = createCallback(holder); Future<Book> future = asyncInvoker ? wc.async().get(callback) : wc.get(callback); Book book = future.get(); assertSame(book, holder.value); assertEquals(124L, book.getId()); validateResponse(wc); }
@Test @org.junit.Ignore public void testEcho() throws Exception { byte[] bytes = ImageHelper.getImageBytes(getImage("/java.jpg"), "image/jpeg"); Holder<byte[]> image = new Holder<>(bytes); Hello port = getPort(); SOAPBinding binding = (SOAPBinding) ((BindingProvider)port).getBinding(); binding.setMTOMEnabled(true); port.echoData(image); assertNotNull(image); }