@ApplicationScoped public class ActivityManagerImpl extends Object implements ActivityManager
Constructor and Description |
---|
ActivityManagerImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsActivity(org.uberfire.mvp.PlaceRequest placeRequest)
Returns an active, accessible activity that can handle the given PlaceRequest.
|
void |
destroyActivity(Activity activity)
Destroys the given Activity bean instance, making it eligible for garbage collection.
|
<T extends Activity> |
getActivities(Class<T> clazz)
Obtains the set of activity instances which implement the given type, are
active , and that
the current user has permission to access . |
Set<Activity> |
getActivities(org.uberfire.mvp.PlaceRequest placeRequest)
Calls to
ActivityManager.getActivities(PlaceRequest) with security checks enabled. |
Set<Activity> |
getActivities(org.uberfire.mvp.PlaceRequest placeRequest,
boolean secure)
Returns the set of activities that can handle the given PlaceRequest.
|
<T extends Activity> |
getActivity(Class<T> clazz,
org.uberfire.mvp.PlaceRequest placeRequest)
Calls to as
ActivityManager.getActivity(Class, PlaceRequest) with security checks enabled. |
<T extends Activity> |
getActivity(Class<T> clazz,
org.uberfire.mvp.PlaceRequest placeRequest,
boolean secure)
Works like
ActivityManager.getActivities(PlaceRequest, boolean) but performs an unsafe cast to treat the return value as an
instance of the given class. |
Activity |
getActivity(org.uberfire.mvp.PlaceRequest placeRequest)
Calls to as
ActivityManager.getActivity(PlaceRequest) with security checks enabled. |
Activity |
getActivity(org.uberfire.mvp.PlaceRequest placeRequest,
boolean secure)
Finds an activity that can handle the given PlaceRequest, creating and starting a new one if necessary.
|
SplashScreenActivity |
getSplashScreenInterceptor(org.uberfire.mvp.PlaceRequest placeRequest)
Returns the splash screen activity that should appear upon navigation to the given place, if such a splash screen
exists.
|
boolean |
isStarted(Activity activity)
Returns true if the given Activity instance is currently in the started or open state and managed
by this ActivityManager.
|
public <T extends Activity> Set<T> getActivities(Class<T> clazz)
ActivityManager
active
, and that
the current user has permission to access
.getActivities
in interface ActivityManager
clazz
- the type of activities to enumerate. Must not be null. Passing in Activity.class
will yield
all possible activity types.ClientBeanManager.destroyBean(Object)
.public SplashScreenActivity getSplashScreenInterceptor(org.uberfire.mvp.PlaceRequest placeRequest)
ActivityManager
getSplashScreenInterceptor
in interface ActivityManager
placeRequest
- the place request to look up a splash screen for.public Set<Activity> getActivities(org.uberfire.mvp.PlaceRequest placeRequest)
ActivityManager
ActivityManager.getActivities(PlaceRequest)
with security checks enabled.getActivities
in interface ActivityManager
public Set<Activity> getActivities(org.uberfire.mvp.PlaceRequest placeRequest, boolean secure)
ActivityManager
Activity
for details on the activity lifecycle). If the PlaceRequest is for a
certain place ID, this method will return a set with at most one activity in it. If the PlaceRequest is for a
certain path, the returned set can contain any number of activities.getActivities
in interface ActivityManager
placeRequest
- the PlaceRequest to resolve activities for. Although null is permitted for convenience, it always
resolves to the empty set.secure
- flag indicating if calls to the AuthorizationManager
service are required in order to
determine which activities are available.ActivityManager.destroyActivity(Activity)
when you
are done with it.public boolean containsActivity(org.uberfire.mvp.PlaceRequest placeRequest)
ActivityManager
containsActivity
in interface ActivityManager
Activity
..public Activity getActivity(org.uberfire.mvp.PlaceRequest placeRequest)
ActivityManager
ActivityManager.getActivity(PlaceRequest)
with security checks enabled.getActivity
in interface ActivityManager
public Activity getActivity(org.uberfire.mvp.PlaceRequest placeRequest, boolean secure)
ActivityManager
getActivity
in interface ActivityManager
placeRequest
- the place the resolved activity should handlesecure
- flag indicating if calls to the AuthorizationManager
service are required in order to
determine if the resulting activity is available.public <T extends Activity> T getActivity(Class<T> clazz, org.uberfire.mvp.PlaceRequest placeRequest)
ActivityManager
ActivityManager.getActivity(Class, PlaceRequest)
with security checks enabled.getActivity
in interface ActivityManager
public <T extends Activity> T getActivity(Class<T> clazz, org.uberfire.mvp.PlaceRequest placeRequest, boolean secure)
ActivityManager
ActivityManager.getActivities(PlaceRequest, boolean)
but performs an unsafe cast to treat the return value as an
instance of the given class. Only use this method if you are absolutely sure which activity type matches the
request. If you are wrong, there will not be a ClassCastException as a result of this call. The safer approach is
to use ActivityManager.getActivities(PlaceRequest, boolean)
and cast its return value explicitly.getActivity
in interface ActivityManager
clazz
- the type of activity that you expect to find.placeRequest
- the place the resolved activity should handlesecure
- flag indicating if calls to the AuthorizationManager
service are required in order to
determine if the resulting activity is available.public void destroyActivity(Activity activity)
ActivityManager
destroyActivity
in interface ActivityManager
activity
- the activity instance to destroy. Warning: do not use with instances of SplashScreenActivity. These
are ApplicationScoped and cannot be destroyed.public boolean isStarted(Activity activity)
ActivityManager
isStarted
in interface ActivityManager
activity
- the activity to checkCopyright © 2012–2019 JBoss by Red Hat. All rights reserved.