Package com.caucho.config.xml

Examples of com.caucho.config.xml.XmlConfigContext


    if (beans.size() == 0)
      return null;

    Bean<?> bean = webBeans.resolve(beans);
   
    XmlConfigContext env = XmlConfigContext.getCurrent();
   
    CreationalContext<?> cxt = null;
   
    if (env != null) {
      cxt = env.getCreationalContext();
     
      if (cxt instanceof CreationalContextImpl<?>) {
        CreationalContextImpl<?> cxtImpl = (CreationalContextImpl<?>) cxt;
       
        Object value = cxtImpl.get(bean);
View Full Code Here


    if (base != null || ! (property instanceof String))
      return null;

    String name = (String) property;

    XmlConfigContext configContext = XmlConfigContext.getCurrent();

    if (configContext == null)
      return null;

    Object result = configContext.findByName(name);

    if (result != null) {
      context.setPropertyResolved(true);

      return result;
View Full Code Here

  @Override
  public <T> void inject(T bean, CreationalContext<T> cxt)
    throws ConfigException
  {
    XmlConfigContext env = XmlConfigContext.getCurrent();
   
    env.configureBean(bean, _node);
  }
View Full Code Here

  @Override
  public <T> void inject(T bean, CreationalContext<T> cxt)
    throws ConfigException
  {
    XmlConfigContext env = XmlConfigContext.create();
   
    CreationalContext<?> oldCxt = env.setCreationalContext(cxt);
   
    try {
      env.configureAttribute(bean, _node);
    } finally {
      env.setCreationalContext(oldCxt);
    }
  }
View Full Code Here

  @Override
  public <T> T create(ConfigType<T> type, CreationalContext<T> cxt)
    throws ConfigException
  {
    XmlConfigContext env = XmlConfigContext.create();
   
    return (T) env.create(_node, type);
  }
View Full Code Here

  {
  }
 
  public String toString()
  {
    XmlConfigContext env = XmlConfigContext.getCurrent();

    if (env != null) {
      String file = env.getBaseUri();

      if (file != null) {
  String dir = Vfs.lookup(file).getParent().getURL();
 
  return Vfs.decode(dir);
View Full Code Here

    ClassLoader oldLoader = thread.getContextClassLoader();

    try {
      thread.setContextClassLoader(_classLoader);

      XmlConfigContext builder = createBuilder();

      InjectManager webBeans = InjectManager.create();

      setProperty("__FILE__", FileVar.__FILE__);
      setProperty("__DIR__", DirVar.__DIR__);

      return builder.configure(obj, topNode);
    } finally {
      thread.setContextClassLoader(oldLoader);
    }
  }
View Full Code Here

    ClassLoader oldLoader = thread.getContextClassLoader();

    try {
      thread.setContextClassLoader(_classLoader);

      XmlConfigContext builder = createBuilder();

      InjectManager webBeans = InjectManager.create();

      setProperty("__FILE__", FileVar.__FILE__);
      setProperty("__DIR__", DirVar.__DIR__);

      builder.configureBean(obj, topNode);
    } finally {
      thread.setContextClassLoader(oldLoader);
    }
  }
View Full Code Here

    }
  }

  private XmlConfigContext createBuilder()
  {
    return new XmlConfigContext(this);
  }
View Full Code Here

   * @param value the attribute value
   */
  public static void setStringAttribute(Object obj, String attr, String value)
    throws Exception
  {
    XmlConfigContext builder = new XmlConfigContext();
    QAttr qAttr = new QAttr(attr);
    qAttr.setValue(value);

    builder.configureAttribute(obj, qAttr);
  }
View Full Code Here

TOP

Related Classes of com.caucho.config.xml.XmlConfigContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.