congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
UserDatabaseRealm
Code IndexAdd Tabnine to your IDE (free)

How to use
UserDatabaseRealm
in
org.apache.catalina.realm

Best Java code snippets using org.apache.catalina.realm.UserDatabaseRealm (Showing top 19 results out of 315)

origin: org.apache.geronimo.ext.tomcat/catalina

UserDatabaseRealm realm = new UserDatabaseRealm();
realm.setResourceName(resourceName);
ObjectName oname = realm.getObjectName();
origin: org.apache.tomcat/tomcat-catalina

/**
 * Create a new  UserDatabaseRealm.
 *
 * @param parent MBean Name of the associated parent component
 * @param resourceName Global JNDI resource name of the associated
 *  UserDatabase
 * @return the object name of the created realm
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createUserDatabaseRealm(String parent, String resourceName)
  throws Exception {
   // Create a new UserDatabaseRealm instance
  UserDatabaseRealm realm = new UserDatabaseRealm();
  realm.setResourceName(resourceName);
  // Add the new instance to its parent component
  return addRealmToParent(parent, realm);
}
origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Prepare for the beginning of active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected void startInternal() throws LifecycleException {
  try {
    Context context = getServer().getGlobalNamingContext();
    database = (UserDatabase) context.lookup(resourceName);
  } catch (Throwable e) {
    ExceptionUtils.handleThrowable(e);
    containerLog.error(sm.getString("userDatabaseRealm.lookup",
                    resourceName),
              e);
    database = null;
  }
  if (database == null) {
    throw new LifecycleException
      (sm.getString("userDatabaseRealm.noDatabase", resourceName));
  }
  super.startInternal();
}
origin: com.github.jsimone/webapp-runner-main

ctxRes.setProperty("pathname", tomcatUsersLocation);
tomcat.getServer().getGlobalNamingResources().addResource(ctxRes);
tomcat.getEngine().setRealm(new org.apache.catalina.realm.UserDatabaseRealm());
origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Create a new  UserDatabaseRealm.
 *
 * @param parent MBean Name of the associated parent component
 * @param resourceName Global JNDI resource name of the associated
 *  UserDatabase
 * @return the object name of the created realm
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createUserDatabaseRealm(String parent, String resourceName)
  throws Exception {
   // Create a new UserDatabaseRealm instance
  UserDatabaseRealm realm = new UserDatabaseRealm();
  realm.setResourceName(resourceName);
  // Add the new instance to its parent component
  return addRealmToParent(parent, realm);
}
origin: org.apache.tomcat/tomcat-catalina

/**
 * Prepare for the beginning of active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *                that prevents this component from being used
 */
@Override
protected void startInternal() throws LifecycleException {
  try {
    Context context = getServer().getGlobalNamingContext();
    database = (UserDatabase) context.lookup(resourceName);
  } catch (Throwable e) {
    ExceptionUtils.handleThrowable(e);
    containerLog.error(sm.getString("userDatabaseRealm.lookup", resourceName), e);
    database = null;
  }
  if (database == null) {
    throw new LifecycleException(
        sm.getString("userDatabaseRealm.noDatabase", resourceName));
  }
  super.startInternal();
}
origin: jsimone/webapp-runner

ctxRes.setProperty("pathname", tomcatUsersLocation);
tomcat.getServer().getGlobalNamingResources().addResource(ctxRes);
tomcat.getEngine().setRealm(new org.apache.catalina.realm.UserDatabaseRealm());
origin: org.apache.catalina/com.springsource.org.apache.catalina

UserDatabaseRealm realm = new UserDatabaseRealm();
realm.setResourceName(resourceName);
ObjectName oname = realm.getObjectName();
origin: codefollower/Tomcat-Research

/**
 * Prepare for the beginning of active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected void startInternal() throws LifecycleException {
  try {
    Context context = getServer().getGlobalNamingContext();
    database = (UserDatabase) context.lookup(resourceName);
  } catch (Throwable e) {
    ExceptionUtils.handleThrowable(e);
    containerLog.error(sm.getString("userDatabaseRealm.lookup",
                    resourceName),
              e);
    database = null;
  }
  if (database == null) {
    throw new LifecycleException
      (sm.getString("userDatabaseRealm.noDatabase", resourceName));
  }
  super.startInternal();
}
origin: codefollower/Tomcat-Research

/**
 * Create a new  UserDatabaseRealm.
 *
 * @param parent MBean Name of the associated parent component
 * @param resourceName Global JNDI resource name of the associated
 *  UserDatabase
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createUserDatabaseRealm(String parent, String resourceName)
  throws Exception {
   // Create a new UserDatabaseRealm instance
  UserDatabaseRealm realm = new UserDatabaseRealm();
  realm.setResourceName(resourceName);
  // Add the new instance to its parent component
  ObjectName pname = new ObjectName(parent);
  Container container = getParentContainerFromParent(pname);
  // Add the new instance to its parent component
  container.setRealm(realm);
  // Return the corresponding MBean name
  ObjectName oname = realm.getObjectName();
  // FIXME getObjectName() returns null
  //ObjectName oname =
  //    MBeanUtils.createObjectName(pname.getDomain(), realm);
  if (oname != null) {
    return (oname.toString());
  } else {
    return null;
  }
}
origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Prepare for the beginning of active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected void startInternal() throws LifecycleException {
  try {
    Context context = getServer().getGlobalNamingContext();
    database = (UserDatabase) context.lookup(resourceName);
  } catch (Throwable e) {
    ExceptionUtils.handleThrowable(e);
    containerLog.error(sm.getString("userDatabaseRealm.lookup",
                    resourceName),
              e);
    database = null;
  }
  if (database == null) {
    throw new LifecycleException
      (sm.getString("userDatabaseRealm.noDatabase", resourceName));
  }
  super.startInternal();
}
origin: com.ovea.tajin.servers/tajin-server-jetty9

UserDatabaseRealm realm = new UserDatabaseRealm();
realm.setResourceName(resourceName);
ObjectName oname = realm.getObjectName();
origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Prepare for the beginning of active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected void startInternal() throws LifecycleException {
  try {
    Context context = getServer().getGlobalNamingContext();
    database = (UserDatabase) context.lookup(resourceName);
  } catch (Throwable e) {
    ExceptionUtils.handleThrowable(e);
    containerLog.error(sm.getString("userDatabaseRealm.lookup",
                    resourceName),
              e);
    database = null;
  }
  if (database == null) {
    throw new LifecycleException
      (sm.getString("userDatabaseRealm.noDatabase", resourceName));
  }
  super.startInternal();
}
origin: com.ovea.tajin.server/tajin-server-tomcat7

UserDatabaseRealm realm = new UserDatabaseRealm();
realm.setResourceName(resourceName);
ObjectName oname = realm.getObjectName();
origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Prepare for the beginning of active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected void startInternal() throws LifecycleException {
  try {
    Context context =
      ((StandardServer)getServer()).getGlobalNamingContext();
    database = (UserDatabase) context.lookup(resourceName);
  } catch (Throwable e) {
    ExceptionUtils.handleThrowable(e);
    containerLog.error(sm.getString("userDatabaseRealm.lookup",
                    resourceName),
              e);
    database = null;
  }
  if (database == null) {
    throw new LifecycleException
      (sm.getString("userDatabaseRealm.noDatabase", resourceName));
  }
  super.startInternal();
}
origin: tomcat/catalina

UserDatabaseRealm realm = new UserDatabaseRealm();
realm.setResourceName(resourceName);
ObjectName oname = realm.getObjectName();
origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Prepare for the beginning of active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected void startInternal() throws LifecycleException {
  try {
    Context context =
      ((StandardServer)getServer()).getGlobalNamingContext();
    database = (UserDatabase) context.lookup(resourceName);
  } catch (Throwable e) {
    ExceptionUtils.handleThrowable(e);
    containerLog.error(sm.getString("userDatabaseRealm.lookup",
                    resourceName),
              e);
    database = null;
  }
  if (database == null) {
    throw new LifecycleException
      (sm.getString("userDatabaseRealm.noDatabase", resourceName));
  }
  super.startInternal();
}
origin: com.ovea.tajin.server/tajin-server-jetty9

UserDatabaseRealm realm = new UserDatabaseRealm();
realm.setResourceName(resourceName);
ObjectName oname = realm.getObjectName();
origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Prepare for the beginning of active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected void startInternal() throws LifecycleException {
  try {
    Context context =
      ((StandardServer)getServer()).getGlobalNamingContext();
    database = (UserDatabase) context.lookup(resourceName);
  } catch (Throwable e) {
    ExceptionUtils.handleThrowable(e);
    containerLog.error(sm.getString("userDatabaseRealm.lookup",
                    resourceName),
              e);
    database = null;
  }
  if (database == null) {
    throw new LifecycleException
      (sm.getString("userDatabaseRealm.noDatabase", resourceName));
  }
  super.startInternal();
}
org.apache.catalina.realmUserDatabaseRealm

Javadoc

Implementation of org.apache.catalina.Realm that is based on an implementation of UserDatabase made available through the global JNDI resources configured for this instance of Catalina. Set the resourceName parameter to the global JNDI resources name for the configured instance of UserDatabase that we should consult.

Most used methods

  • <init>
  • setResourceName
    Set the global JNDI name of the UserDatabase resource we will be using.
  • getServer
  • getObjectName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
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