Tabnine Logo
RpcContext
Code IndexAdd Tabnine to your IDE (free)

How to use
RpcContext
in
org.jboss.errai.bus.server.api

Best Java code snippets using org.jboss.errai.bus.server.api.RpcContext (Showing top 20 results out of 315)

origin: org.jboss.errai/errai-bus

public ServerCallableFuture() {
 incomingMessage = RpcContext.getMessage();
}
origin: org.jboss.errai/errai-bus

RpcContext.set(message);
return method.invoke(serviceProvider.get(message), (parms != null) ? parms.toArray(new Object[parms.size()]) : new Object[0]);
RpcContext.remove();
origin: org.jboss.errai/errai-bus

/**
 * @return the HTTP session object associated with this {@link Thread}
 */
public static HttpSession getHttpSession() {
 final QueueSession qs = getQueueSession();
 if (qs == null) {
  return null;
 }
 
 return qs.getAttribute(HttpSession.class, HttpSession.class.getName());
}
origin: org.kie.workbench.stunner/kie-wb-common-stunner-backend-common

public String getPathRelativeToApp(final String path) {
  final String wbp = null != path ? (path.trim().length() == 0 || ".".equals(path) ?
      WEBINF_PATH :
      WEBINF_PATH + "/" + path) :
      WEBINF_PATH;
  return RpcContext.getServletRequest()
      .getServletContext()
      .getRealPath(wbp)
      .replaceAll("\\\\",
            "/");
}
origin: errai/errai

@Override
public void logout() {
 if (keycloakIsLoggedIn()) {
  keycloakLogout();
  
  try {
   if (RpcContext.getMessage() != null)
    ((HttpServletRequest) RpcContext.getServletRequest()).logout();
  } catch (ServletException e) {
   throw new AuthenticationException("An error occurred while attempting to log out of Keycloak.");
  }
 }
 else if (wrappedAuthService.isLoggedIn()) {
  wrappedAuthService.logout();
 }
}
origin: errai/errai

@Override
public void logout() {
 identity.logout();
 RpcContext.getHttpSession().invalidate();
}
origin: org.uberfire/uberfire-server

@Before
public void setup() {
  when(authService.getUser()).thenThrow(new AssertionError("Should not call authentication service"));
  when(threadMessage.getResource(QueueSession.class,
                  "Session")).thenReturn(threadQueueSession);
  when(threadQueueSession.getSessionId()).thenReturn(sessionUser.getIdentifier());
  RpcContext.set(null);
}
origin: org.uberfire/uberfire-server

  private String getSessionId() {
    return (getMessage() != null && getQueueSession() != null ? getQueueSession().getSessionId() : null);
  }
}
origin: kiegroup/appformer

public MessageReader() {
  this(() -> RpcContext.getServletRequest().getLocale());
}
origin: org.jboss.errai/errai-security-picketlink

@Override
public void logout() {
 identity.logout();
 RpcContext.getHttpSession().invalidate();
}
origin: kiegroup/appformer

@Test
public void returnAuthenticatedUserInSessionThread() {
  when(userInstance.isAmbiguous()).thenReturn(false);
  when(userInstance.isUnsatisfied()).thenReturn(false);
  when(userInstance.get()).thenReturn(defaultUser);
  reset(authService);
  when(authService.getUser()).thenReturn(sessionUser);
  RpcContext.set(threadMessage);
  SessionInfo sessionInfo = factory.getSessionInfo(authService);
  assertSame(sessionUser,
        sessionInfo.getIdentity());
}
origin: kiegroup/appformer

  private String getSessionId() {
    return (getMessage() != null && getQueueSession() != null ? getQueueSession().getSessionId() : null);
  }
}
origin: org.overlord.rtgov.ui/rtgov-ui-core

  @AroundInvoke
  public Object bindUserContext(InvocationContext invocationContext) throws Exception {
    HttpServletRequest servletRequest = (HttpServletRequest) getServletRequest();
    IUserContext.Holder.setPrincipal(servletRequest.getUserPrincipal());
    try {
      return invocationContext.proceed();
    } finally {
      IUserContext.Holder.removeSecurityContext();
    }
  }
}
origin: org.dashbuilder/dashbuilder-services

@PostConstruct
protected void init() {
  // By default, enable the register of data set definitions stored into the deployment folder.
  ServletContext servletContext = RpcContext.getHttpSession().getServletContext();
  if (!dataSetDefDeployer.isRunning() && servletContext != null) {
    String dir = servletContext.getRealPath("WEB-INF/datasets");
    if (dir != null && new File(dir).exists()) {
      dir = dir.replaceAll("\\\\", "/");
      dataSetDefDeployer.deploy(dir);
    }
  }
}
origin: org.jboss.errai/errai-bus

/**
 * @return the QueueSession associated with this {@link Thread}
 */
public static QueueSession getQueueSession() {
 final Message m = getMessage();
 if (m == null) {
  return null;
 }
 
 return m.getResource(QueueSession.class, "Session");
}
origin: kiegroup/appformer

@Before
public void setup() {
  when(authService.getUser()).thenThrow(new AssertionError("Should not call authentication service"));
  when(threadMessage.getResource(QueueSession.class,
                  "Session")).thenReturn(threadQueueSession);
  when(threadQueueSession.getSessionId()).thenReturn(sessionUser.getIdentifier());
  RpcContext.set(null);
}
origin: errai/errai

RpcContext.set(message);
return method.invoke(serviceProvider.get(message), (parms != null) ? parms.toArray(new Object[parms.size()]) : new Object[0]);
RpcContext.remove();
origin: errai/errai

/**
 * @return the HTTP session object associated with this {@link Thread}
 */
public static HttpSession getHttpSession() {
 final QueueSession qs = getQueueSession();
 if (qs == null) {
  return null;
 }
 
 return qs.getAttribute(HttpSession.class, HttpSession.class.getName());
}
origin: org.kie.workbench.forms/kie-wb-common-forms-adf-engine-backend

public BackendI18nHelper(I18nSettings settings) {
  super(settings);
  bundle = ResourceBundle.getBundle(settings.getBundle(),
                   RpcContext.getServletRequest().getLocale());
}
origin: org.dashbuilder/dashbuilder-services

@PostConstruct
protected void init() {
  // By default, enable the register of data set definitions stored into the deployment folder.
  ServletContext servletContext = RpcContext.getHttpSession().getServletContext();
  if (!dataSetDefDeployer.isRunning() && servletContext != null) {
    String dir = servletContext.getRealPath("WEB-INF/datasets");
    if (dir != null && new File(dir).exists()) {
      dir = dir.replaceAll("\\\\", "/");
      dataSetDefDeployer.deploy(dir);
    }
  }
}
org.jboss.errai.bus.server.apiRpcContext

Javadoc

This utility provides access to Message resources otherwise not visible to RPC endpoints. It can be used to gain access to HTTP session and servlet request objects.

Most used methods

  • getServletRequest
  • getHttpSession
  • getMessage
  • set
    Reads resources from the provided Message and stores them in ThreadLocals.
  • getQueueSession
  • remove
    Removes the resources associated with the current thread.

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now