示例#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;
   }
 }
示例#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);
     }
   }
 }
示例#3
0
 public final int getMaxOccurs() {
   final boolean unbounded = XsdU.UNBOUNDED.equals(maxOccurs);
   return ((unbounded) ? Integer.MAX_VALUE : Value.defaultOnNull(maxOccurs, 1));
 }
示例#4
0
 public final int getMinOccurs() {
   return Value.defaultOnNull(minOccurs, 1);
 }
示例#5
0
 private String getIDPrivate(final TypeInstance parentInstance) {
   return Value.join(XsdU.DOT, parentInstance.getID(), getName());
 }
示例#6
0
 public final String getID() {
   return Value.join(XsdU.DOT, getName(), dataType.getQName().getLocalPart());
 }