private <T> ServiceRegistration<T> registerService(BundleContext context, Class<T> serviceInterface, T serviceObject, String servicePid) { return context.registerService(serviceInterface, serviceObject, CollectionUtils.singletonDictionary(Constants.SERVICE_PID, servicePid)); }
public static <S, T> Dictionary<S, T> singletonDictionary(S s, T t) { return toDictionary(Collections.singletonMap(s, t)); }
@Override public void renderHead(final IHeaderResponse response) { super.renderHead(response); if (org.apache.cxf.common.util.CollectionUtils.isEmpty(attrs.getObject()) && org.apache.cxf.common.util.CollectionUtils.isEmpty(membershipTOs.getObject())) { response.render(OnDomReadyHeaderItem.forScript( String.format("$('#emptyPlaceholder').append(\"%s\"); $('#attributes').hide();", getString("attribute.empty.list")))); } }
protected Map<String, String> keepInOrder(Map<String, String> params, OperationInfo operation, List<String> order) { if (params == null || order == null) { return params; } Map<String, String> orderedParameters = new LinkedHashMap<String, String>(); for (String name : order) { orderedParameters.put(name, params.get(name)); } if (order.size() != params.size()) { LOG.fine(order.size() + " parameters definded in WSDL but found " + params.size() + " in request!"); Collection<String> rest = CollectionUtils.diff(order, params.keySet()); if (rest != null && rest.size() > 0) { LOG.fine("Set the following parameters to null: " + rest); for (Iterator<String> iter = rest.iterator(); iter.hasNext();) { String key = iter.next(); orderedParameters.put(key, null); } } } return orderedParameters; }
ArtifactResolutionResult result = repositorySystem.resolve(request); Artifact resolvedArtifact = result.getOriginatingArtifact(); if (resolvedArtifact == null && !CollectionUtils.isEmpty(result.getArtifacts())) { resolvedArtifact = result.getArtifacts().iterator().next();
protected Map<String, String> keepInOrder(Map<String, String> params, OperationInfo operation, List<String> order) { if (params == null || order == null) { return params; } Map<String, String> orderedParameters = new LinkedHashMap<String, String>(); for (String name : order) { orderedParameters.put(name, params.get(name)); } if (order.size() != params.size()) { LOG.fine(order.size() + " parameters definded in WSDL but found " + params.size() + " in request!"); Collection<String> rest = CollectionUtils.diff(order, params.keySet()); if (rest != null && rest.size() > 0) { LOG.fine("Set the following parameters to null: " + rest); for (Iterator<String> iter = rest.iterator(); iter.hasNext();) { String key = iter.next(); orderedParameters.put(key, null); } } } return orderedParameters; }
if (CollectionUtils.isEmpty(message.getMessageParts())) { return fields;
@Override public HttpService addingService(ServiceReference<HttpService> reference) { HttpService httpService = context.getService(reference); Servlet servlet = new CXFNonSpringServlet(destinationRegistry, false); servletExporter = new ServletExporter(servlet, httpService); servletPublisherReg = context.registerService(ManagedService.class, servletExporter, CollectionUtils.singletonDictionary(Constants.SERVICE_PID, CXF_CONFIG_PID)); return httpService; } }
|| StringUtils.isAllBlank(originaObj.getUDynMembershipCond(), inner.getUDynMembershipCond()) || !inner.getUDynMembershipCond().equals(originaObj.getUDynMembershipCond()) || !CollectionUtils.diff(inner.getTypeExtensions(), originaObj.getTypeExtensions()).isEmpty();
public static <S, T> Dictionary<S, T> singletonDictionary(S s, T t) { return toDictionary(Collections.singletonMap(s, t)); }
if (CollectionUtils.isEmpty(message.getMessageParts())) { return fields;
private <T> ServiceRegistration<T> registerService(BundleContext context, Class<T> serviceInterface, T serviceObject, String servicePid) { return context.registerService(serviceInterface, serviceObject, CollectionUtils.singletonDictionary(Constants.SERVICE_PID, servicePid)); }
private void registerBusAsService() { BundleContext context = bus.getExtension(BundleContext.class); if (context != null) { Map<String, Object> props = new HashMap<>(); props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, context.getBundle().getSymbolicName()); props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(context.getBundle())); props.put(CONTEXT_NAME_PROPERTY, bus.getId()); service = context.registerService(Bus.class.getName(), bus, CollectionUtils.toDictionary(props)); } }
Operation operation = (Operation)ite2.next(); Collection<Fault> faults = CastUtils.cast(operation.getFaults().values()); if (CollectionUtils.isEmpty(faults)) { continue;
private <T> ServiceRegistration<T> registerManagedServiceFactory(BundleContext context, Class<T> serviceClass, T service, String servicePid) { return context.registerService(serviceClass, service, CollectionUtils.singletonDictionary(Constants.SERVICE_PID, servicePid)); }
private void registerBusAsService() { BundleContext context = bus.getExtension(BundleContext.class); if (context != null) { Map<String, Object> props = new HashMap<>(); props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, context.getBundle().getSymbolicName()); props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(context.getBundle())); props.put(CONTEXT_NAME_PROPERTY, bus.getId()); service = context.registerService(Bus.class.getName(), bus, CollectionUtils.toDictionary(props)); } }
Operation operation = (Operation)ite2.next(); Collection<Fault> faults = CastUtils.cast(operation.getFaults().values()); if (CollectionUtils.isEmpty(faults)) { continue;
private <T> ServiceRegistration<T> registerManagedServiceFactory(BundleContext context, Class<T> serviceClass, T service, String servicePid) { return context.registerService(serviceClass, service, CollectionUtils.singletonDictionary(Constants.SERVICE_PID, servicePid)); }
private void createCXFBus() { BlueprintBus bp = new BlueprintBus(); bp.setBundleContext(bundleContext); bp.setBlueprintContainer(container); bp.setId("WS-Notification"); bp.initialize(); if (null != bundleContext) { Map<String, Object> props = new HashMap<>(); props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, bundleContext.getBundle().getSymbolicName()); props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(bundleContext.getBundle())); props.put(CONTEXT_NAME_PROPERTY, bp.getId()); bundleContext.registerService(Bus.class.getName(), bp, CollectionUtils.toDictionary(props)); } cxfBus = bp; } private Version getBundleVersion(Bundle bundle) {