Codota Logo
Container.getBean
Code IndexAdd Codota to your IDE (free)

How to use
getBean
method
in
org.directwebremoting.Container

Best Java code snippets using org.directwebremoting.Container.getBean (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.directwebremoting/dwr

/**
 * Internal method to allow us to get the WebContextBuilder from which we
 * will get WebContext objects.
 * Do NOT call this method from outside of DWR.
 */
public static void attach(Container container)
{
  WebContextFactory.builder = container.getBean(WebContextBuilder.class);
}
origin: org.directwebremoting/dwr

/**
 * Read the {@link Container} and cache the values
 */
private void init()
{
  if (proxy == null)
  {
    proxy = new HashMap<String, Object>();
    for (String name : container.getBeanNames())
    {
      Object value = container.getBean(name);
      if (!filterNonStringValues || value instanceof String)
      {
        proxy.put(name, value);
      }
    }
  }
}
origin: org.directwebremoting/dwr

/**
 *
 */
public static ConverterManager getConverterManager()
{
  return container.getBean(ConverterManager.class);
}
origin: org.directwebremoting/dwr

/**
 * Internal helper for getting at a ConverterManager
 * @return Our ConverterManager
 */
protected ConverterManager getConverterManager()
{
  if (converterManager == null)
  {
    converterManager = container.getBean(ConverterManager.class);
  }
  return converterManager;
}
origin: org.directwebremoting/dwr

/**
 * Internal helper for getting at a ScriptSessionManager
 * @return Our ScriptSessionManager
 */
protected ScriptSessionManager getScriptSessionManager()
{
  if (sessionManager == null)
  {
    sessionManager = container.getBean(ScriptSessionManager.class);
  }
  return sessionManager;
}
origin: org.directwebremoting/dwr

/**
 * Look up the Handler associated with the URL in the named URL property.
 * F ex supply the property name "engineHandlerUrl" to look up EngineHandler.
 *
 * @param container The container to look into
 * @param property a URL property name known by the container (usually
 * declared in defaults.properties)
 * @return the Handler registered on the URL
 */
public static Handler getHandlerForUrlProperty(Container container, String property)
{
  String registeredHandlerUrl = (String) container.getBean(property);
  return (Handler) container.getBean("url:" + registeredHandlerUrl);
}
origin: org.directwebremoting/dwr

/**
 * Get an boolean setting from the Container.
 * @param container The container to look into
 * @param name The name of the setting to investigate
 * @param defaultValue The value to return if none is given
 * @return The value of the setting as an boolean, or the defaultValue if the
 * setting is empty or not convertible.
 */
public static boolean getBooleanSetting(Container container, String name, boolean defaultValue)
{
  Object value = container.getBean(name);
  if (value == null)
  {
    return defaultValue;
  }
  return Boolean.parseBoolean(value.toString());
}
origin: org.directwebremoting/dwr

/**
 * Internal method to allow us to get the Builder from which we will get
 * created objects. Do NOT call this method from outside of DWR.
 * This function should <em>only</em> be called during startup.
 * our Container Builder from.
 */
public T attach(Container container)
{
  this.builder = container.getBean(created);
  return builder.attach(container);
}
origin: org.directwebremoting/dwr

public String getContextPath()
{
  UrlProcessor urlProcessor = container.getBean(UrlProcessor.class);
  return urlProcessor.getContextPath();
}
origin: org.directwebremoting/dwr

/**
 * Clean up the current thread when {@link #outOfContainerInit()} has been
 * called.
 * @param container The container created by {@link #outOfContainerInit()}.
 */
public static void outOfContainerDestroy(Container container)
{
  WebContextBuilder webContextBuilder = container.getBean(WebContextBuilder.class);
  if (webContextBuilder != null)
  {
    webContextBuilder.disengageThread();
  }
}
origin: org.directwebremoting/dwr

public void engageThread(Container container, HttpServletRequest request, HttpServletResponse response)
{
  try
  {
    ServletConfig servletConfig = container.getBean(ServletConfig.class);
    ServletContext servletContext = container.getBean(ServletContext.class);
    WebContext ec = new DefaultWebContext(container, request, response, servletConfig, servletContext);
    engageThread(ec);
  }
  catch (Exception ex)
  {
    log.fatal("Failed to create an ExecutionContext", ex);
  }
}
origin: org.directwebremoting/dwr

public PageScriptSessionFilter(ServerContext serverContext, String page)
{
  PageNormalizer pageNormalizer = serverContext.getContainer().getBean(PageNormalizer.class);
  this.page = pageNormalizer.normalizePage(page);
}
origin: org.directwebremoting/dwr

/**
 * Annotations must not break 1.3, so we use reflection to create an
 * <code>org.directwebremoting.annotations.AnnotationsConfigurator</code>
 * and the catch all sorts of random exceptions for the benefit of
 * Websphere.
 * @param container The container to configure
 * @return true if the configuration worked.
 */
public static boolean configureFromAnnotations(Container container)
{
  Object data = container.getBean("classes");
  if (null != data)
  {
    Configurator configurator = new AnnotationsConfigurator();
    configurator.configure(container);
    Loggers.STARTUP.debug("Java5 AnnotationsConfigurator enabled");
    return true;
  }
  return false;
}
origin: org.directwebremoting/dwr

  public static String sanitizeErrorMessage(String errorMessage)
  {
    boolean debug = false;

    Object debugVal = WebContextFactory.get().getContainer().getBean("debug");
    if (debugVal != null)
    {
      debug = LocalUtil.simpleConvert(debugVal.toString(), Boolean.class);
    }

    if (debug)
    {
      return "null /* " + errorMessage.replace("*/", "* /") + " */";
    }
    else
    {
      return "null";
    }
  }
}
origin: org.apache.tuscany.sca/tuscany-implementation-web-client

/**
 * Add an SCA service to be added to the DWR runtime
 */
public void addService(RuntimeEndpointReference epr) {
  
  CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());
  addService(creatorManager, epr);
  serviceRefs.put(epr.getReference().getName(), epr);
}
origin: org.directwebremoting/dwr

@Override
public void destroy()
{
  webContextBuilder = container.getBean(WebContextBuilder.class);
  if (webContextBuilder != null)
  {
    webContextBuilder.engageThread(container, null, null);
  }
  container.destroy();
  if (webContextBuilder != null)
  {
    webContextBuilder.disengageThread();
  }
  super.destroy();
}
origin: org.directwebremoting/dwr

/**
 * Generates and returns a new unique id suitable to use for the
 * CSRF session cookie. This method is itself exempted from CSRF checking.
 */
public String generateId()
{
  WebContext webContext = WebContextFactory.get();
  // If the current session already has a set DWRSESSIONID then we return that
  HttpServletRequest request = webContext.getHttpServletRequest();
  HttpSession sess = request.getSession(false);
  if (sess != null && sess.getAttribute(ATTRIBUTE_DWRSESSIONID) != null)
  {
    return (String) sess.getAttribute(ATTRIBUTE_DWRSESSIONID);
  }
  // Otherwise generate a fresh ID
  IdGenerator idGenerator = webContext.getContainer().getBean(IdGenerator.class);
  return idGenerator.generate();
}
origin: org.directwebremoting/dwr

@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
  try
  {
    webContextBuilder.engageThread(container, request, response);
    UrlProcessor processor = container.getBean(UrlProcessor.class);
    processor.handle(request, response);
  }
  finally
  {
    webContextBuilder.disengageThread();
  }
}
origin: org.directwebremoting/dwr

/**
 * Something has published to the client side 'hub' and we're getting to
 * know about it.
 * @param topic The topic that has been published to
 * @param data The published data
 */
public void publish(String topic, RealRawData data)
{
  WebContext webContext = WebContextFactory.get();
  ConverterManager converterManager = webContext.getContainer().getBean(ConverterManager.class);
  Hub hub = HubFactory.get();
  MessageEvent event = new DefaultMessageEvent(hub, converterManager, data);
  hub.publish(topic, event);
}
origin: org.directwebremoting/dwr

/**
 * Process the @Filter annotation
 * @param filterAnn The filter annotation
 * @param name The Javascript name of the class to filter
 * @param container The IoC container to configure
 */
protected void processFilter(Filter filterAnn, String name, Container container)
{
  Map<String, String> filterParams = getParamsMap(filterAnn.params());
  AjaxFilter filter = LocalUtil.classNewInstance(name, filterAnn.type().getName(), AjaxFilter.class);
  if (filter != null)
  {
    LocalUtil.setParams(filter, filterParams, null);
    AjaxFilterManager filterManager = container.getBean(AjaxFilterManager.class);
    filterManager.addAjaxFilter(filter, name);
  }
}
org.directwebremotingContainergetBean

Javadoc

Get the contained instance of a bean of a given type

Popular methods of Container

  • destroy
    Closes down all parts of DWR in a timely way, stops threads, and performs tidy-up.
  • getBeanNames
    Get a list of all the available beans. Implementation of this method is optional so it is valid for
  • initializeBean
    Sometimes we need to take a bean not created by the container, and inject it with the data that it w
  • newInstance
    Sometimes we need to create a bean as a one-off object and have it injected with settings by the con

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • startActivity (Activity)
  • orElseThrow (Optional)
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • BoxLayout (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now