Refine search
/** * * @param serviceClass * @param loaderClass * @return */ public static <T> Optional<T> loadSingle(Class<T> serviceClass, Class<?> loaderClass) { Iterator<T> iterator = ServiceLoader.load(serviceClass, WildFlySecurityManager.getClassLoaderPrivileged(loaderClass)).iterator(); T service = null; while (iterator.hasNext()) { if (service != null) { throw new IllegalStateException("Exactly one service provider is required for: " + serviceClass); } service = iterator.next(); } return Optional.ofNullable(service); }
@Override public final IllegalStateException cannotInjectObjectOutsideOfServletRequest(final Object param1, final Throwable cause) { final IllegalStateException result = new IllegalStateException(java.text.MessageFormat.format(cannotInjectObjectOutsideOfServletRequest$str(), param1), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
if (isBuilt()) { throw new IllegalStateException("BeanIdentifier index is already built!"); tempIndex.add(((CommonBean<?>) bean).getIdentifier()); } else if (bean instanceof PassivationCapable) { tempIndex.add(new StringBeanIdentifier(((PassivationCapable) bean).getId())); BootstrapLogger.LOG.beanIdentifierIndexBuilt(getDebugInfo());
@Override public BeanIdentifier deprefix(String id) { String deprefixed = id.substring(getPrefix().length() + getDelimiter().length()); if (index == null) { return new StringBeanIdentifier(deprefixed); } if (deprefixed.startsWith(FALLBACK_FLAG)) { return new StringBeanIdentifier(deprefixed.substring(FALLBACK_FLAG.length())); } try { return index.getIdentifier(Integer.parseInt(deprefixed)); } catch (NumberFormatException e) { throw new IllegalStateException("Unable to deprefix id:" + id, e); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
@Override public String getLocalizedMessage() { return getMessage(); }
@Override public final IllegalStateException cannotInjectServletContext(final ClassLoader classLoader, final ServletContextService service) { final IllegalStateException result = new IllegalStateException(java.text.MessageFormat.format(cannotInjectServletContext$str(), classLoader, service)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
if (isBuilt()) { throw new IllegalStateException("BeanIdentifier index is already built!"); tempIndex.add(((CommonBean<?>) bean).getIdentifier()); } else if (bean instanceof PassivationCapable) { tempIndex.add(new StringBeanIdentifier(((PassivationCapable) bean).getId())); BootstrapLogger.LOG.beanIdentifierIndexBuilt(getDebugInfo());
@Override public BeanIdentifier deprefix(String id) { String deprefixed = id.substring(getPrefix().length() + getDelimiter().length()); if (index == null) { return new StringBeanIdentifier(deprefixed); } if (deprefixed.startsWith(FALLBACK_FLAG)) { return new StringBeanIdentifier(deprefixed.substring(FALLBACK_FLAG.length())); } try { return index.getIdentifier(Integer.parseInt(deprefixed)); } catch (NumberFormatException e) { throw new IllegalStateException("Unable to deprefix id:" + id, e); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
@Override public String getLocalizedMessage() { return getMessage(); }
@Override public final IllegalStateException stereotypeNotRegistered(final Object param1) { final IllegalStateException result = new IllegalStateException(java.text.MessageFormat.format(stereotypeNotRegistered$str(), param1)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String qualifierOnStereotype = "WELD-001103: Cannot declare qualifiers on stereotype {0}";
if (isBuilt()) { throw new IllegalStateException("BeanIdentifier index is already built!"); tempIndex.add(((CommonBean<?>) bean).getIdentifier()); } else if (bean instanceof PassivationCapable) { tempIndex.add(new StringBeanIdentifier(((PassivationCapable) bean).getId())); BootstrapLogger.LOG.beanIdentifierIndexBuilt(getDebugInfo());
@Override public BeanIdentifier deprefix(String id) { String deprefixed = id.substring(getPrefix().length() + getDelimiter().length()); if (index == null) { return new StringBeanIdentifier(deprefixed); } if (deprefixed.startsWith(FALLBACK_FLAG)) { return new StringBeanIdentifier(deprefixed.substring(FALLBACK_FLAG.length())); } try { return index.getIdentifier(Integer.parseInt(deprefixed)); } catch (NumberFormatException e) { throw new IllegalStateException("Unable to deprefix id:" + id, e); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
@Override public String getLocalizedMessage() { return getMessage(); }
@Override public final IllegalStateException noBeanStoreAvailable(final Object param1) { final IllegalStateException result = new IllegalStateException(java.text.MessageFormat.format(noBeanStoreAvailable$str(), param1)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
if (isBuilt()) { throw new IllegalStateException("BeanIdentifier index is already built!"); tempIndex.add(((CommonBean<?>) bean).getIdentifier()); } else if (bean instanceof PassivationCapable) { tempIndex.add(new StringBeanIdentifier(((PassivationCapable) bean).getId())); BootstrapLogger.LOG.beanIdentifierIndexBuilt(getDebugInfo());
@Override public BeanIdentifier deprefix(String id) { String deprefixed = id.substring(getPrefix().length() + getDelimiter().length()); if (index == null) { return new StringBeanIdentifier(deprefixed); } if (deprefixed.startsWith(FALLBACK_FLAG)) { return new StringBeanIdentifier(deprefixed.substring(FALLBACK_FLAG.length())); } try { return index.getIdentifier(Integer.parseInt(deprefixed)); } catch (NumberFormatException e) { throw new IllegalStateException("Unable to deprefix id:" + id, e); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }