com.ibm.mfp.adapter.api

Class MFPJAXRSApplication

  • java.lang.Object
    • Application
      • com.ibm.mfp.adapter.api.MFPJAXRSApplication
  • Direct Known Subclasses:
    MFPJAXRSApplication


    public abstract class MFPJAXRSApplication
    extends Application

    An extended JAX-RS Application class made to be used by MobileFirst Java Adapters.

    In addition to getSingletones() and getClasses() it also has "init" and "destroy" methods that will be called when initializing the JAX-RS application and when shutting it down.

    There is an additional feature of package scanning to find JAX-RS resources. Override the getPackageToScan or getPackagesToScan methods to customize which package(s) to scan. By default, the package of the application class will be scanned. For example: if your application class is: com.acme.restapp.MyApplication, then the package 'com.acme.restapp' will be scanned for JAX-RS resources.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      protected void destroy()
      This method is called when un-deploying the adapter
      protected java.lang.String[] getPackagesToScan()
      Returns a list of packages that will be scanned to find JAX-RS resources for this application
      protected java.lang.String getPackageToScan()
      Returns a package that will be scanned to find JAX-RS resources for this application
      protected void init()
      This method is called on initialization
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MFPJAXRSApplication

        public MFPJAXRSApplication()
    • Method Detail

      • getPackagesToScan

        protected java.lang.String[] getPackagesToScan()
        Returns a list of packages that will be scanned to find JAX-RS resources for this application
        Returns:
      • getPackageToScan

        protected java.lang.String getPackageToScan()
        Returns a package that will be scanned to find JAX-RS resources for this application
        Returns:
      • init

        protected void init()
                     throws java.lang.Exception
        This method is called on initialization
        Throws:
        java.lang.Exception
      • destroy

        protected void destroy()
                        throws java.lang.Exception
        This method is called when un-deploying the adapter
        Throws:
        java.lang.Exception


© Copyright IBM Corp. 2006, 2015. All Rights Reserved.