@ Override public Application getApplication ( String appName , boolean includeRemoteRegion ) { Application app = null ; Map < String , Lease < InstanceInfo > > leaseMap = registry . get ( appName ) ; if ( leaseMap != null && leaseMap . size ( ) > 0 ) { for ( Entry < String , Lease < InstanceInfo > > entry : leaseMap . entrySet ( ) ) { if ( app == null ) { app = new Application ( appName ) ; } app . addInstance ( decorateInstanceInfo ( entry . getValue ( ) ) ) ; } } else if ( includeRemoteRegion ) { for ( RemoteRegionRegistry remoteRegistry : this . regionNameVSRemoteRegistry . values ( ) ) { Application application = remoteRegistry . getApplication ( appName ) ; if ( application != null ) { return application ; } } } return app ; }
Get application information .