Examples of ServerContext


Examples of com.sun.enterprise.server.ServerContext

     *
     * @return number of intervals.
     */   
    public int getNumOfIntervals() {
        try {
            ServerContext sc = ApplicationServer.getServerContext();
            if (sc != null) {
                LogService ls = ServerBeansFactory.getConfigBean(sc.getConfigContext()).getLogService();
                numOfIntervals = Integer.parseInt(ls.getRetainErrorStatisticsForHours());
            }
        }catch(Exception n) {
            numOfIntervals = MIN_INTERVALS;
        }
View Full Code Here

Examples of com.sun.enterprise.server.ServerContext

                    return name;
            }
        }
       
        try {
            ServerContext sc = ApplicationServer.getServerContext();       
            if (sc!=null)  {
                Config cfg = ServerBeansFactory.getConfigBean(sc.getConfigContext());
                ModuleLogLevels allModulesLogLevels = cfg.getLogService().getModuleLogLevels( );
                ElementProperty[] elementProperties = allModulesLogLevels.getElementProperty( );
                if( elementProperties != null ) {
                    for( int i = 0; i < elementProperties.length; i++ ) {
                        String name = elementProperties[i].getName();
View Full Code Here

Examples of com.sun.enterprise.server.ServerContext

      //Its a no-op, so return
      return;
  }
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
          ServerContext ctxt = ApplicationServer.getServerContext();
    if (ctxt != null) {
                    registry_ = ctxt.getMonitoringRegistry();
    }
                return null;
            }
        });
View Full Code Here

Examples of com.sun.enterprise.server.ServerContext

     * Creates the File under the specified instance directory
     */
    public String createFileName( ) {
        if ( (absoluteFileName != null&& (! absoluteFileName.equals("")) )
            return getAbsoluteLogFileName();
        ServerContext sc = ApplicationServer.getServerContext();
        String instDir = "";
        if (sc != null) {
            instDir = sc.getInstanceEnvironment().getInstancesRoot();
        } else {
            instDir = System.getProperty( INSTANCE_ROOT_PROPERTY );
        }
        String[] names = {instDir, LOGS_DIR, getLogFileName() };
        // Create an absolute log filename
View Full Code Here

Examples of com.sun.enterprise.server.ServerContext

            return;
        }

        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
              ServerContext ctxt = ApplicationServer.getServerContext();
                if (ctxt != null ) {
                    registry_ = ctxt.getMonitoringRegistry();
                }
                return null;
            }
        });
View Full Code Here

Examples of com.sun.enterprise.server.ServerContext

    public void onTermination()
  throws ServerLifecycleException {
  _logger.log(Level.FINE, "CascadingLifecycleImpl.onTermination");

  // vars
  ServerContext sc = ApplicationServer.getServerContext();
  ConfigContext configContext = sc.getConfigContext();
  String instanceName = sc.getInstanceName();

  // cleanup

  // determine the instance type for appropriate processing
  try {
View Full Code Here

Examples of com.sun.enterprise.server.ServerContext

        _logger.log(Level.FINE, "CascadingLifecycleImpl.stopDASCascading");

  // get the jmx connector for the DAS
  // and invoke InstanceCascadingMBean on DAS

  ServerContext sc = ApplicationServer.getServerContext();
  ConfigContext configContext = sc.getConfigContext();
  if (! isDASRunning(configContext) ) {
    _logger.log(Level.FINE, "cascading.dasisnotrunning");
    return;
  }   
  try {

      // get DAS server instance name
      Server dasServer = ServerHelper.getDAS(configContext);
      String dasInstanceName = dasServer.getName();

      // get MBeanServerConnection
            MBeanServerConnection mbsc =
    ServerHelper.connect(configContext, dasInstanceName);

            // invoke InstanceCascadingMBean on DAS
      ObjectName on = new ObjectName(
    getInstanceCascadingMBeanObjName(sc, dasInstanceName));

      String[] signature = {"java.lang.String"};
      Object[] param=new Object[1];
      param[0]=(Object) sc.getInstanceName();

      mbsc.invoke(on, "stopCascadeInstance", param, signature);

  } catch(MalformedObjectNameException mone) {
            mone.printStackTrace();
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.server.ServerContext

     */
    protected void handleRead(SelectionKey key) {
      FrameBuffer buffer = (FrameBuffer) key.attachment();
      ThriftTracer readTracer = ThriftTracer.NOTHING;
      if (buffer.context_ != null) {
        ServerContext context = buffer.context_;
        if (context instanceof ThriftTrace) {
          ThriftTrace thriftTrace = (ThriftTrace) context;
          readTracer = thriftTrace.getTracer("thrift - handle read");
        }
      }
      readTracer.start();
      try {
        if (!buffer.read()) {
          cleanupSelectionKey(key);
          return;
        }
      } finally {
        readTracer.end();
      }

      // if the buffer's frame read is complete, invoke the method.
      if (buffer.isFrameFullyRead()) {
        ThriftTracer processTracer = ThriftTracer.NOTHING;
        if (buffer.context_ != null) {
          ServerContext context = buffer.context_;
          if (context instanceof ThriftTrace) {
            ThriftTrace thriftTrace = (ThriftTrace) context;
            processTracer = thriftTrace.getTracer("thrift - handle request");
          }
        }
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.server.ServerContext

     */
    protected void handleWrite(SelectionKey key) {
      FrameBuffer buffer = (FrameBuffer) key.attachment();
      ThriftTracer writeTracer = ThriftTracer.NOTHING;
      if (buffer.context_ != null) {
        ServerContext context = buffer.context_;
        if (context instanceof ThriftTrace) {
          ThriftTrace thriftTrace = (ThriftTrace) context;
          writeTracer = thriftTrace.getTracer("thrift - handle write");
        }
      }
View Full Code Here

Examples of org.apache.ldap.server.jndi.ServerContext

     *
     * @return the principal making the call
     */
    public static LdapPrincipal getPrincipal( Invocation call )
    {
        ServerContext ctx = ( ServerContext ) call.getContextStack().peek();
        return ctx.getPrincipal();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.