org.jboss.seam.annotations.Install.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(10.3k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.jboss.seam.annotations.Install.<init>()方法的一些代码示例,展示了Install.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Install.<init>()方法的具体详情如下:
包路径:org.jboss.seam.annotations.Install
类名称:Install
方法名:<init>

Install.<init>介绍

暂无

代码示例

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * A component for direct rendering of
 * templates. Especially useful with
 * Seam Mail. 
 *
 */
@Name("org.jboss.seam.faces.renderer")
@Install(false)
public abstract class Renderer
{
  public abstract String render(String viewId);
  
  public static Renderer instance()
  {
    return (Renderer) Component.getInstance(Renderer.class);
  }
}

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Dummy component that lets us install the
 * EjbSynchronizations via the tag
 * transaction:ejb-transaction
 *
 * @see EjbSynchronizations
 * @author Gavin King
 * 
 */
@Name("org.jboss.seam.transaction.ejbTransaction")
@Scope(ScopeType.STATELESS)
@Install(precedence=BUILT_IN, value=false)
@BypassInterceptors
public class EjbTransaction {}

代码示例来源:origin: org.jboss.seam/jboss-seam

@Name("org.jboss.seam.core.ConversationIdGenerator")
@Scope(ScopeType.APPLICATION)
@Install(precedence=Install.BUILT_IN)
public class ConversationIdGenerator
{
  private static AtomicInteger uniqueId = new AtomicInteger(0);

  public String getNextId() {
    //TODO: this is not cluster safe!!!!!
    return Integer.toString(uniqueId.incrementAndGet());
  }   

  public static ConversationIdGenerator instance() {
    ConversationIdGenerator instance = 
      (ConversationIdGenerator) Component.getInstance("org.jboss.seam.core.ConversationIdGenerator");
    return (instance!=null) ? instance : new ConversationIdGenerator();
  }
}

代码示例来源:origin: org.jboss.seam/jboss-seam-debug

@Name("org.jboss.seam.debug.jsf.debugRedirect")
@BypassInterceptors
@Install(debug = true, precedence = BUILT_IN, classDependencies = "javax.faces.context.FacesContext")
public class DebugRedirect
{
  private String viewId;

  public String getViewId()
  {
   return viewId;
  }

  public void setViewId(String viewId)
  {
   this.viewId = viewId;
  }

  public void execute()
  {
   FacesManager.instance().redirect(viewId, null, false);
  }
}

代码示例来源:origin: org.jboss.seam/jboss-seam

@Scope(ScopeType.EVENT)
@BypassInterceptors
@Install(false)
public class ManagedTopicPublisher

代码示例来源:origin: org.jboss.seam/jboss-seam

@Scope(ScopeType.STATELESS)
@Name("org.jboss.seam.async.asynchronousExceptionHandler")
@Install(precedence=BUILT_IN)
@BypassInterceptors
public class AsynchronousExceptionHandler
{

  private LogProvider log = Logging.getLogProvider(AsynchronousExceptionHandler.class);
    public void handleException(Exception throwable)
  {
   log.error("Exception thrown whilst executing asynchronous call", throwable);
  }
    public static AsynchronousExceptionHandler instance()
  {
   return (AsynchronousExceptionHandler) Component.getInstance(AsynchronousExceptionHandler.class);
  }
  }

代码示例来源:origin: opentoutatice-ecm.collab-tools/opentoutatice-collab-tools-ecm

/**
 * @author David Chevrier.
 *
 */
@Name("webActions")
@Scope(ScopeType.CONVERSATION)
@Install(precedence = ExtendedSeamPrecedence.ADD_ON)
public class ToutaticeCTWebActionsBean extends ToutaticeWebActionsBean {

  private static final long serialVersionUID = -6124671913159928250L;

  @Override
  public boolean isInPortalViewContext() {
    WidgetsAdapterService widgetsAdapterService = Framework.getLocalService(WidgetsAdapterService.class);
    widgetsAdapterService.addPortalViewsIds("send_notification_email", "document_notif_email", "confirm_mail_sending", "mail_sending");
    return widgetsAdapterService.isInPortalViewContext();
  }

}

代码示例来源:origin: org.jboss.seam/jboss-seam

@Name("org.jboss.seam.faces.validation")
@BypassInterceptors
@Install(precedence=BUILT_IN, classDependencies="javax.faces.context.FacesContext")
public class Validation

代码示例来源:origin: org.jboss.seam/jboss-seam

@Name("org.jboss.seam.mock.mockSecureEntity")
@Install(false)
@Entity
public class MockSecureEntity implements Serializable

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Support for injecting the JSF FacesContext object
 * 
 * @author Gavin King
 */
@Scope(ScopeType.APPLICATION)
@BypassInterceptors
@Name("org.jboss.seam.faces.facesContext")
@Install(precedence=BUILT_IN, classDependencies="javax.faces.context.FacesContext")
public class FacesContext
{
  @Unwrap
  public javax.faces.context.FacesContext getContext()
  {
   return javax.faces.context.FacesContext.getCurrentInstance();
  }
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-webapp-base

/**
 * Externalize serverLocation Factory to avoid NavigationContext reentrant calls
 *
 * @author Thierry Delprat
 */
@Name("serverLocator")
@Scope(CONVERSATION)
@Install(precedence = FRAMEWORK)
public class ServerContextBean implements Serializable {

  private static final long serialVersionUID = 1L;

  private RepositoryLocation currentServerLocation;

  @Factory(value = "currentServerLocation", scope = EVENT)
  public RepositoryLocation getCurrentServerLocation() {
    return currentServerLocation;
  }

  public void setRepositoryLocation(RepositoryLocation serverLocation) {
    this.currentServerLocation = serverLocation;
  }
}

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Manager component for the current locale that is
 * aware of the selected locale
 * 
 * @author Gavin King
 */
@Scope(ScopeType.STATELESS)
@Name("org.jboss.seam.core.locale")
@Install(precedence=FRAMEWORK, dependencies="org.jboss.seam.international.localeSelector")
@BypassInterceptors
public class Locale extends org.jboss.seam.core.Locale
{

  @Unwrap @Override
  public java.util.Locale getLocale()
  {
   return Contexts.isSessionContextActive() ?
      LocaleSelector.instance().getLocale() :
      super.getLocale();
  }
  }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-webapp-base

@Name("treeInvalidator")
@Scope(SESSION)
@Install(precedence = Install.FRAMEWORK)
public class TreeInvalidatorBean implements Serializable {

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Manager component for the current locale that is
 * aware of the HTTP request locale
 * 
 * @author Gavin King
 */
@Scope(ScopeType.STATELESS)
@Name("org.jboss.seam.core.locale")
@Install(precedence=FRAMEWORK-1)
@BypassInterceptors
public class Locale extends org.jboss.seam.core.Locale
{

  @Unwrap @Override
  public java.util.Locale getLocale()
  {
   ServletContexts servletContexts = ServletContexts.getInstance();
   ServletRequest request = servletContexts==null ? null : servletContexts.getRequest();
   return request==null ? super.getLocale() : request.getLocale();
  }
  }

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Support for the pooled task list.
 * 
 * @see TaskInstanceList
 * @author Gavin King
 */
@Name("org.jboss.seam.bpm.pooledTaskInstanceList")
@Scope(ScopeType.APPLICATION)
@Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
public class PooledTaskInstanceList
{
    @Unwrap
  @Transactional
  public List<TaskInstance> getPooledTaskInstanceList()
  {
   Actor actor = Actor.instance();
   String actorId = actor.getId();
   if ( actorId == null ) return null;
   ArrayList groupIds = new ArrayList( actor.getGroupActorIds() );
   groupIds.add(actorId);
   return ManagedJbpmContext.instance().getGroupTaskList(groupIds);
  }
  }

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Manager component for the current user's locale
 * 
 * @author Gavin King
 */
@Scope(ScopeType.STATELESS)
@Name("org.jboss.seam.international.timeZone")
@BypassInterceptors
@Install(precedence=BUILT_IN, dependencies="org.jboss.seam.international.timeZoneSelector")
public class TimeZone 
{

  @Unwrap
  public java.util.TimeZone getTimeZone()
  {
   return TimeZoneSelector.instance().getTimeZone();
  }
    public static java.util.TimeZone instance()
  {
   return (java.util.TimeZone) Component.getInstance(TimeZone.class, ScopeType.STATELESS);
  }
  }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-webapp-base

@Name("appNameFactory")
@Scope(ScopeType.STATELESS)
@Install(precedence = FRAMEWORK)
public class NuxeoProductNameFactory implements Serializable {

  private static final long serialVersionUID = 1L;

  @Factory(value = "nuxeoApplicationName", scope = ScopeType.APPLICATION)
  public String getNuxeoProductName() {
    return Framework.getProperty(Environment.PRODUCT_NAME);
  }

  @Factory(value = "nuxeoApplicationVersion", scope = ScopeType.APPLICATION)
  public String getNuxeoProductVersion() {
    return Framework.getProperty(Environment.PRODUCT_VERSION);
  }

  /**
   * Gives current year used in copyright (in case this needs to be extracted from a configuration in the future).
   *
   * @since 5.9.2
   */
  @Factory(value = "copyrightCurrentYear", scope = ScopeType.APPLICATION)
  public String getCurrentYearAsString() {
    return new DateTime().toString("Y");
  }

}

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Manager component for a map of roles assigned
 * to the current user, as exposed via the JSF
 * ExternalContext.
 * 
 * @author Gavin King
 */
@Scope(ScopeType.APPLICATION)
@BypassInterceptors
@Name("org.jboss.seam.web.isUserInRole")
@Install(precedence=FRAMEWORK, classDependencies="javax.faces.context.FacesContext")
public class IsUserInRole extends org.jboss.seam.web.IsUserInRole
{
  @Override
  protected Boolean isUserInRole(String role)
  {
   FacesContext facesContext = FacesContext.getCurrentInstance();
   if ( facesContext != null ) 
   {
     return facesContext.getExternalContext().isUserInRole(role);
   }
   
   return super.isUserInRole(role);
  }
}

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Support for the task list.
 * 
 * @see TaskInstanceListForType
 * @see PooledTask
 * @author <a href="mailto:steve@hibernate.org">Steve Ebersole</a>
 * @author Gavin King
 */
@Name("org.jboss.seam.bpm.taskInstanceList")
@Scope(APPLICATION)
@Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
public class TaskInstanceList
{
    @Unwrap
  @Transactional
  public List<TaskInstance> getTaskInstanceList()
  {
   return getTaskInstanceList( Actor.instance().getId() );
  }

  private List<TaskInstance> getTaskInstanceList(String actorId)
  {
   if ( actorId == null ) return null;

   return ManagedJbpmContext.instance().getTaskList(actorId);
  }
  }

代码示例来源:origin: org.jboss.seam/jboss-seam

/**
 * Factory for method and value bindings in a JSF environment.
 * 
 * @author Gavin King
 */
@Scope(ScopeType.APPLICATION)
@BypassInterceptors
@Install(precedence=FRAMEWORK, classDependencies="javax.faces.context.FacesContext")
@Name("org.jboss.seam.core.expressions")
public class FacesExpressions extends Expressions
{
    /**
  * Get an appropriate ELContext. If there is an active JSF request,
  * use JSF's ELContext. Otherwise, use one that we created.
  */
  @Override
  public ELContext getELContext()
  {
   return isFacesContextActive() ? FacesContext.getCurrentInstance().getELContext() : super.getELContext();
  }
    @Override
  protected boolean isFacesContextActive()
  { 
   return FacesContext.getCurrentInstance() != null && FacesLifecycle.getPhaseId() != null;
  }
  }

相关文章

微信公众号

最新文章

更多

Install类方法