当前位置: 首页>>代码示例>>Java>>正文


Java ClassHelper类代码示例

本文整理汇总了Java中com.helger.commons.lang.ClassHelper的典型用法代码示例。如果您正苦于以下问题:Java ClassHelper类的具体用法?Java ClassHelper怎么用?Java ClassHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ClassHelper类属于com.helger.commons.lang包,在下文中一共展示了ClassHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onAfterInstantiation

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void onAfterInstantiation (@Nonnull final IScope aScope)
{
  try
  {
    // MPC manager before PMode manager
    m_aMPCMgr = new MPCManager (MPC_XML);
    m_aPModeMgr = new PModeManager (PMODE_XML);
    m_aProfileMgr = new AS4ProfileManager ();
    m_aIncomingDuplicateMgr = new AS4DuplicateManager (INCOMING_DUPLICATE_XML);

    _initCallbacks ();

    // Validate content
    m_aPModeMgr.validateAllPModes ();

    s_aLogger.info (ClassHelper.getClassLocalName (this) + " was initialized");
  }
  catch (final Throwable t)
  {
    throw new InitializationException ("Failed to init " + ClassHelper.getClassLocalName (this), t);
  }
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:24,代码来源:MetaAS4Manager.java

示例2: scheduleMe

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public static void scheduleMe (final long nDisposalMinutes)
{
  if (nDisposalMinutes > 0)
  {
    if (!s_aScheduled.getAndSet (true))
    {
      final JobDataMap aJobDataMap = new JobDataMap ();
      aJobDataMap.putIn (KEY_MINUTES, nDisposalMinutes);
      GlobalQuartzScheduler.getInstance ()
                           .scheduleJob (ClassHelper.getClassLocalName (AS4DuplicateCleanupJob.class) +
                                         "-" +
                                         nDisposalMinutes,
                                         JDK8TriggerBuilder.newTrigger ()
                                                           .startNow ()
                                                           .withSchedule (SimpleScheduleBuilder.repeatMinutelyForever (5)),
                                         AS4DuplicateCleanupJob.class,
                                         aJobDataMap);
    }
    // else already scheduled
  }
  else
  {
    s_aLogger.warn ("Incoming duplicate message cleaning is disabled!");
  }
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:26,代码来源:AS4DuplicateCleanupJob.java

示例3: onAfterInstantiation

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void onAfterInstantiation (@Nonnull final IScope aScope)
{
  try
  {
    m_aLucene = new PDLucene ();
    m_aStorageMgr = new PDStorageManager (m_aLucene);
    m_aIndexerMgr = new PDIndexerManager (m_aStorageMgr);
    m_aHttpClientMgr = new HttpClientManager ();

    s_aLogger.info (ClassHelper.getClassLocalName (this) + " was initialized");
  }
  catch (final Throwable t)
  {
    if (GlobalDebug.isProductionMode ())
    {
      new InternalErrorBuilder ().setThrowable (t)
                                 .addErrorMessage (ClassHelper.getClassLocalName (this) + " init failed")
                                 .handle ();
    }

    throw new InitializationException ("Failed to init " + ClassHelper.getClassLocalName (this), t);
  }
}
 
开发者ID:phax,项目名称:peppol-directory,代码行数:25,代码来源:PDMetaManager.java

示例4: getClassPathURL

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
/**
 * Get the URL for the specified path using automatic class loader handling.
 * The class loaders are iterated in the following order:
 * <ol>
 * <li>Default class loader (usually the context class loader)</li>
 * <li>The class loader of this class</li>
 * <li>The system class loader</li>
 * </ol>
 *
 * @param sPath
 *        The path to be resolved. May neither be <code>null</code> nor empty.
 * @return <code>null</code> if the path could not be resolved.
 */
@Nullable
public static URL getClassPathURL (@Nonnull @Nonempty final String sPath)
{
  ValueEnforcer.notEmpty (sPath, "Path");

  // Use the default class loader. Returns null if not found
  URL ret = ClassLoaderHelper.getResource (ClassLoaderHelper.getDefaultClassLoader (), sPath);
  if (ret == null)
  {
    // This is essential if we're running as a web application!!!
    ret = ClassHelper.getResource (URLHelper.class, sPath);
    if (ret == null)
    {
      // this is a fix for a user that needed to have the application
      // loaded by the bootstrap class loader
      ret = ClassLoaderHelper.getResource (ClassLoaderHelper.getSystemClassLoader (), sPath);
    }
  }
  return ret;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:34,代码来源:URLHelper.java

示例5: getCollectionBaseTypeOfClass

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Nullable
public static ECollectionBaseType getCollectionBaseTypeOfClass (@Nullable final Class <?> aClass)
{
  if (aClass != null)
  {
    // Query Set before Collection, because Set is derived from Collection!
    if (Set.class.isAssignableFrom (aClass))
      return ECollectionBaseType.SET;
    if (Collection.class.isAssignableFrom (aClass))
      return ECollectionBaseType.COLLECTION;
    if (Map.class.isAssignableFrom (aClass))
      return ECollectionBaseType.MAP;
    if (ClassHelper.isArrayClass (aClass))
      return ECollectionBaseType.ARRAY;
    if (Iterator.class.isAssignableFrom (aClass))
      return ECollectionBaseType.ITERATOR;
    if (Iterable.class.isAssignableFrom (aClass))
      return ECollectionBaseType.ITERABLE;
    if (Enumeration.class.isAssignableFrom (aClass))
      return ECollectionBaseType.ENUMERATION;
  }
  return null;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:24,代码来源:CollectionHelper.java

示例6: handle

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void handle (@Nullable final IReadableResource aRes,
                       @Nonnull final IErrorLevel aErrorLevel,
                       @Nullable final IPSElement aSourceElement,
                       @Nonnull final String sMessage,
                       @Nullable final Throwable t)
{
  final SingleErrorBuilder aBuilder = SingleError.builder ()
                                                 .setErrorLevel (aErrorLevel)
                                                 .setErrorLocation (aRes == null ? null
                                                                                 : new SimpleLocation (aRes.getResourceID ()))
                                                 .setErrorText (sMessage)
                                                 .setLinkedException (t);

  if (aSourceElement != null)
  {
    String sField = ClassHelper.getClassLocalName (aSourceElement);
    if (aSourceElement instanceof IPSHasID && ((IPSHasID) aSourceElement).hasID ())
      sField += " [ID=" + ((IPSHasID) aSourceElement).getID () + "]";
    aBuilder.setErrorFieldName (sField);
  }
  m_aErrorList.add (aBuilder.build ());
}
 
开发者ID:phax,项目名称:ph-schematron,代码行数:24,代码来源:AbstractCollectingPSErrorHandler.java

示例7: onAfterInstantiation

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void onAfterInstantiation (@Nonnull final IScope aScope)
{
  try
  {
    // TODO add managers here

    // Use only the configured SML (if any)
    // By default both official PEPPOL SMLs are queried!
    final ISMLInfo aSML = PDServerConfiguration.getSMLToUse ();
    if (aSML != null)
      PDMetaManager.setBusinessCardProvider (new SMPBusinessCardProvider (aSML));

    s_aLogger.info (ClassHelper.getClassLocalName (this) + " was initialized");
  }
  catch (final Throwable t)
  {
    if (GlobalDebug.isProductionMode ())
    {
      new InternalErrorBuilder ().setThrowable (t)
                                 .addErrorMessage (ClassHelper.getClassLocalName (this) + " init failed")
                                 .handle ();
    }

    throw new InitializationException ("Failed to init " + ClassHelper.getClassLocalName (this), t);
  }
}
 
开发者ID:phax,项目名称:peppol-directory,代码行数:28,代码来源:PDPMetaManager.java

示例8: GlobalScope

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public GlobalScope (@Nonnull @Nonempty final String sScopeID)
{
  super (sScopeID);

  if (ScopeHelper.debugGlobalScopeLifeCycle (s_aLogger))
    s_aLogger.info ("Created global scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
                    ScopeHelper.getDebugStackTrace ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:9,代码来源:GlobalScope.java

示例9: preDestroy

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void preDestroy ()
{
  if (ScopeHelper.debugGlobalScopeLifeCycle (s_aLogger))
    s_aLogger.info ("Destroying global scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
                    ScopeHelper.getDebugStackTrace ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:GlobalScope.java

示例10: postDestroy

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void postDestroy ()
{
  if (ScopeHelper.debugGlobalScopeLifeCycle (s_aLogger))
    s_aLogger.info ("Destroyed global scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
                    ScopeHelper.getDebugStackTrace ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:GlobalScope.java

示例11: SessionScope

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public SessionScope (@Nonnull @Nonempty final String sScopeID)
{
  super (sScopeID);

  // Sessions are always displayed to see what's happening
  if (ScopeHelper.debugSessionScopeLifeCycle (s_aLogger))
    s_aLogger.info ("Created session scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
                    ScopeHelper.getDebugStackTrace ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:10,代码来源:SessionScope.java

示例12: preDestroy

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void preDestroy ()
{
  if (ScopeHelper.debugSessionScopeLifeCycle (s_aLogger))
    s_aLogger.info ("Destroying session scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
                    ScopeHelper.getDebugStackTrace ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:SessionScope.java

示例13: postDestroy

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void postDestroy ()
{
  if (ScopeHelper.debugSessionScopeLifeCycle (s_aLogger))
    s_aLogger.info ("Destroyed session scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
                    ScopeHelper.getDebugStackTrace ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:SessionScope.java

示例14: RequestScope

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public RequestScope (@Nonnull @Nonempty final String sScopeID, @Nonnull @Nonempty final String sSessionID)
{
  super (sScopeID);
  m_sSessionID = ValueEnforcer.notEmpty (sSessionID, "SessionID");

  // done initialization
  if (ScopeHelper.debugRequestScopeLifeCycle (s_aLogger))
    s_aLogger.info ("Created request scope '" + sScopeID + "' of class " + ClassHelper.getClassLocalName (this),
                    ScopeHelper.getDebugStackTrace ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:11,代码来源:RequestScope.java

示例15: preDestroy

import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void preDestroy ()
{
  if (ScopeHelper.debugRequestScopeLifeCycle (s_aLogger))
    s_aLogger.info ("Destroying request scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
                    ScopeHelper.getDebugStackTrace ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:RequestScope.java


注:本文中的com.helger.commons.lang.ClassHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。