Exemple #1
0
 @SuppressWarnings({"PMD.OnlyOneReturn", "PMD.AvoidCatchingThrowable"})
 private CronRunnable getRunnable(final String className, final CronParams params) {
   try {
     final Class<?> c = Class.forName(className);
     final Constructor<?> ctor = c.getConstructor(CronParams.class);
     return (CronRunnable) ctor.newInstance(params);
   } catch (Throwable e) {
     logger.warning(Value.join(Http.Token.SLASH, e.getClass().getSimpleName(), e.getMessage()));
     return null;
   }
 }
Exemple #2
0
 private static void setCustomSocketFactory(final String certificate, final Properties properties)
     throws IOException {
   if (!Value.isEmpty(certificate)) {
     try {
       final TLSContext tlsContext =
           new TLSContextFactory().create(certificate, "TLS"); // i18n JRE
       TLSSocketFactory.initialize(tlsContext.getContext());
       properties.setProperty(
           "mail.smtp.ssl.socketFactory.class", TLSSocketFactory.class.getName());
       properties.setProperty("mail.smtp.ssl.socketFactory.fallback", Boolean.FALSE.toString());
     } catch (GeneralSecurityException e) {
       throw new IOException(e);
     }
   }
 }
Exemple #3
0
 public final int getMaxOccurs() {
   final boolean unbounded = XsdU.UNBOUNDED.equals(maxOccurs);
   return ((unbounded) ? Integer.MAX_VALUE : Value.defaultOnNull(maxOccurs, 1));
 }
Exemple #4
0
 public final int getMinOccurs() {
   return Value.defaultOnNull(minOccurs, 1);
 }
Exemple #5
0
 private String getIDPrivate(final TypeInstance parentInstance) {
   return Value.join(XsdU.DOT, parentInstance.getID(), getName());
 }
Exemple #6
0
 public final String getID() {
   return Value.join(XsdU.DOT, getName(), dataType.getQName().getLocalPart());
 }