public FormattedServiceListWriter(String styleSheetPath, String title, boolean showForeignContexts, Bus bus) { this.styleSheetPath = styleSheetPath; this.title = title; this.showForeignContexts = showForeignContexts; this.bus = bus; if (this.bus != null) { this.atomMap = CastUtils.cast((Map<?, ?>)this.bus.getProperty("org.apache.cxf.extensions.logging.atom.pull")); } }
private void writeUnformattedRESTfulEndpoints(PrintWriter writer, String baseAddress, AbstractDestination[] destinations) throws IOException { for (AbstractDestination sd : destinations) { String address = getAbsoluteAddress(baseAddress, sd); boolean wadlAvailable = bus != null && PropertyUtils.isTrue(bus.getProperty("wadl.service.descrition.available")); boolean swaggerAvailable = bus != null && PropertyUtils.isTrue(bus.getProperty("swagger.service.descrition.available")); if (!wadlAvailable && !swaggerAvailable) { writer.write(address + "\n"); return; } if (wadlAvailable) { writer.write(address + "?_wadl\n"); } if (swaggerAvailable) { writer.write(address + "/swagger.json\n"); } } }
if (sb != null && PropertyUtils.isTrue(sb.getProperty("wadl.service.description.available"))) { writer.write("<br/><span class=\"field\">WADL :</span> " + "<a href=\"" + absoluteURL + "?_wadl\">" + absoluteURL + "?_wadl" + "</a>"); if (sb != null && PropertyUtils.isTrue(sb.getProperty("swagger.service.description.available"))) { String swaggerPath = "swagger.json"; if (PropertyUtils.isTrue(sb.getProperty("swagger.service.ui.available"))) { URI uri = URI.create(absoluteURL); String schemePath = uri.getScheme() + "://" + uri.getHost()
privateEndpoints = (List<String>)bus.getProperty("org.apache.cxf.private.endpoints"); } else { privateEndpoints = new ArrayList<>();
/** * Constructor * * @param b the associated Bus * @param registry the destination registry * @param ei the endpoint info of the destination * @param path the path * @param dp true for adding the default port if it is missing * @throws IOException */ public AbstractHTTPDestination(Bus b, DestinationRegistry registry, EndpointInfo ei, String path, boolean dp) throws IOException { super(b, getTargetReference(getAddressValue(ei, dp), b), ei); this.bus = b; this.registry = registry; this.path = path; try { ServletRequest.class.getMethod("isAsyncSupported"); isServlet3 = true; } catch (Throwable t) { //servlet 2.5 or earlier, no async support } decodeBasicAuthWithIso8859 = PropertyUtils.isTrue(bus.getProperty(DECODE_BASIC_AUTH_WITH_ISO8859)); initConfig(); }
peferredTransportId = (String)getBus().getProperty(AbstractTransportFactory.PREFERRED_TRANSPORT_ID);
private static String getGlobalCacheManagerName(Bus bus) { if (bus != null) { return (String) bus.getProperty(GLOBAL_EHCACHE_MANAGER_NAME); } return null; } }
private static String getBusProperty(Bus b, String key, String dflt) { String v = (String)b.getProperty(key); return v != null ? v : dflt; }
private static String getBusProperty(Bus b, String key, String dflt) { String v = (String)b.getProperty(key); return v != null ? v : dflt; }
private static String getBusProperty(Bus b, String key, String dflt) { String v = (String)b.getProperty(key); return v != null ? v : dflt; }
private static boolean getBusProperty(Bus b, String key, boolean dflt) { Object v = b.getProperty(key); if (v instanceof Boolean) { return (Boolean)v; } return v != null ? Boolean.valueOf(v.toString()) : dflt; } }
@SuppressWarnings("unchecked") private Map<Class<?>, Map<Class<?>, ThreadLocalProxy<?>>> getConstructorProxyMap(boolean create) { Object property = bus.getProperty(CONSTRUCTOR_PROXY_MAP); if (property == null) { Map<Class<?>, Map<Class<?>, ThreadLocalProxy<?>>> map = new ConcurrentHashMap<>(2); bus.setProperty(CONSTRUCTOR_PROXY_MAP, map); property = map; } return (Map<Class<?>, Map<Class<?>, ThreadLocalProxy<?>>>)property; }
public static Class<?> getRealClass(Bus bus, Object o) { bus = getBus(bus); if (bus != null && bus.getProperty(ClassUnwrapper.class.getName()) != null) { ClassUnwrapper unwrapper = (ClassUnwrapper) bus.getProperty(ClassUnwrapper.class.getName()); return unwrapper.getRealClass(o); } return getContextClassHelper(bus).getRealClassInternal(o); }
public static Class<?> getRealClass(Bus bus, Object o) { bus = getBus(bus); if (bus != null && bus.getProperty(ClassUnwrapper.class.getName()) != null) { ClassUnwrapper unwrapper = (ClassUnwrapper) bus.getProperty(ClassUnwrapper.class.getName()); return unwrapper.getRealClass(o); } return getContextClassHelper(bus).getRealClassInternal(o); }
private boolean shouldCheckUrl(Bus bus) { Object prop = null; if (bus != null) { prop = bus.getProperty(DO_NOT_CHECK_URL_PROP); } if (prop == null) { prop = SystemPropertyAction.getPropertyOrNull(DO_NOT_CHECK_URL_PROP); } return !PropertyUtils.isTrue(prop); }
private boolean shouldCheckUrl(Bus bus) { Object prop = null; if (bus != null) { prop = bus.getProperty(DO_NOT_CHECK_URL_PROP); } if (prop == null) { prop = SystemPropertyAction.getPropertyOrNull(DO_NOT_CHECK_URL_PROP); } return !PropertyUtils.isTrue(prop); }
private boolean shouldCheckUrl(Bus bus) { Object prop = null; if (bus != null) { prop = bus.getProperty(DO_NOT_CHECK_URL_PROP); } if (prop == null) { prop = SystemPropertyAction.getPropertyOrNull(DO_NOT_CHECK_URL_PROP); } return !PropertyUtils.isTrue(prop); }
private boolean shouldCheckUrl(Bus bus) { Object prop = null; if (bus != null) { prop = bus.getProperty(DO_NOT_CHECK_URL_PROP); } if (prop == null) { prop = SystemPropertyAction.getPropertyOrNull(DO_NOT_CHECK_URL_PROP); } return !PropertyUtils.isTrue(prop); }
@Test public void testProxyClassIsProperlyUnwrapped() { final BookStorePreMatchingRequestFilter filter = getBeanReference(BookStorePreMatchingRequestFilter.class); final ClassUnwrapper unwrapper = (ClassUnwrapper)bus.getProperty(ClassUnwrapper.class.getName()); assertThat(unwrapper, notNullValue()); assertThat(filter.getClass(), not(equalTo(BookStorePreMatchingRequestFilter.class))); assertThat(unwrapper.getRealClass(filter), equalTo(BookStorePreMatchingRequestFilter.class)); }
@Test public void testRealClassIsProperlyUnwrapped() { final BookStoreRequestFilter filter = getBeanReference(BookStoreRequestFilter.class); final ClassUnwrapper unwrapper = (ClassUnwrapper)bus.getProperty(ClassUnwrapper.class.getName()); assertThat(unwrapper, notNullValue()); assertThat(filter.getClass(), equalTo(BookStoreRequestFilter.class)); assertThat(unwrapper.getRealClass(filter), equalTo(BookStoreRequestFilter.class)); } }