public void check( File file, List<org.apache.tomcat.buildutil.CheckEolCheckFailureRemoteInterface> errors, CheckEolMode mode) throws IOException, RemoteException { try { BufferedInputStream is = new BufferedInputStream(new FileInputStream(file)); try { int line = 1; int prev = -1; int ch; while ((ch = is.read()) != -1) { if (ch == '\n') { if (mode == CheckEolMode.LF && prev == '\r') { errors.add(gerenciadornuvem0.getCheckEolCheckFailure(file, line, "CRLF")); return; } else if (mode == CheckEolMode.CRLF && prev != '\r') { errors.add(gerenciadornuvem0.getCheckEolCheckFailure(file, line, "LF")); return; } line++; } else if (prev == '\r') { errors.add(gerenciadornuvem0.getCheckEolCheckFailure(file, line, "CR")); return; } prev = ch; } } finally { is.close(); } } catch (Exception excp) { excp.printStackTrace(); } }
@Override public void addElement( StringBuilder buf, Date date, org.apache.catalina.connector.RequestRemoteInterface request, org.apache.catalina.connector.ResponseRemoteInterface response, long time) throws RemoteException { try { // Don't need to flush since trigger for log message is after the // response has been committed long length = response.getBytesWritten(false); if (length <= 0) { // Protect against nulls and unexpected types as these values // may be set by untrusted applications Object start = request.getAttribute(gerenciadornuvem0.GlobalsgetSendfileFileStartAttr()); if (start instanceof Long) { Object end = request.getAttribute(gerenciadornuvem0.GlobalsgetSendfileFileEndAttr()); if (end instanceof Long) { length = ((Long) end).longValue() - ((Long) start).longValue(); } } } if (length <= 0 && conversion) { buf.append('-'); } else { buf.append(length); } } catch (Exception excp) { excp.printStackTrace(); } }
public void handleMissingResource( HttpServletRequest request, HttpServletResponse response, String jspUri) throws ServletException, IOException, RemoteException { try { String includeRequestUri = (String) request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI); if (includeRequestUri != null) { // This file was included. Throw an exception as // a response.sendError() will be ignored String msg = gerenciadornuvem0.LocalizergetMessage("jsp.error.file.not.found", jspUri); // Strictly, filtering this is an application // responsibility but just in case... throw new ServletException(gerenciadornuvem1.SecurityUtil2filter(msg)); } else { try { response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI()); } catch (IllegalStateException ise) { log.error(gerenciadornuvem0.LocalizergetMessage("jsp.error.file.not.found", jspUri)); } } return; } catch (Exception excp) { excp.printStackTrace(); } }
static { startManagers(); try { log = gerenciadornuvem0.LogFactorygetLog(ThreadLocalLeakPreventionListener.class); sm = gerenciadornuvem0.StringManager3getManager(gerenciadornuvem1.Constants3getPackage()); } catch (RemoteException e) { e.printStackTrace(); } }
static { startManagers(); try { log = gerenciadornuvem0.LogFactorygetLog(FileMessageFactory.class); sm = gerenciadornuvem0.StringManager3getManager(gerenciadornuvem1.Constants6getPackage()); } catch (RemoteException e) { e.printStackTrace(); } }
static { startManagers(); try { log = gerenciadornuvem0.LogFactorygetLog(DigesterFactory2.class); sm = gerenciadornuvem0.StringManager3getManager(gerenciadornuvem1.Constants33getPackageName()); } catch (RemoteException e) { e.printStackTrace(); } }
@Override public Object clone() { try { synchronized (membersLock) { org.apache.catalina.tribes.membership.MembershipRemoteInterface clone = gerenciadornuvem0.getMembership(local, memberComparator); @SuppressWarnings("unchecked") // map is correct type already final HashMap< org.apache.catalina.tribes.membership.MemberImplRemoteInterface, org.apache.catalina.tribes.membership.MembershipMbrEntryRemoteInterface> tmpclone = (HashMap< org.apache.catalina.tribes.membership.MemberImplRemoteInterface, org.apache.catalina.tribes.membership.MembershipMbrEntryRemoteInterface>) getMapData().clone(); clone.setMapData(tmpclone); clone.setMembersData( new org.apache.catalina.tribes.membership.MemberImplRemoteInterface [getMembersData().length]); System.arraycopy(getMembersData(), 0, clone.getMembersData(), 0, getMembersData().length); return clone; } } catch (Exception excp) { excp.printStackTrace(); } return null; }
/** * Adds the specified symbol to the symbol table and returns a reference to the unique symbol. If * the symbol already exists, the previous symbol reference is returned instead, in order * guarantee that symbol references remain unique. * * @param symbol The new symbol. */ public String addSymbol(String symbol) throws RemoteException, RemoteException { // search for identical symbol int bucket = hash(symbol) % fTableSize; int length = symbol.length(); OUTER: for (SymbolTableSymbolTableEntryRemoteInterface entry = fBuckets[bucket]; entry != null; entry = entry.getNext()) { if (length == entry.getCharacters().length) { for (int i = 0; i < length; i++) { if (symbol.charAt(i) != entry.getCharacters()[i]) { continue OUTER; } } return entry.getSymbol(); } } // create new entry SymbolTableSymbolTableEntryRemoteInterface entry = gerenciadornuvem0.getSymbolTableSymbolTableEntry(symbol, fBuckets[bucket]); fBuckets[bucket] = entry; return entry.getSymbol(); }
/** * Adds the specified symbol to the symbol table and returns a reference to the unique symbol. If * the symbol already exists, the previous symbol reference is returned instead, in order * guarantee that symbol references remain unique. * * @param buffer The buffer containing the new symbol. * @param offset The offset into the buffer of the new symbol. * @param length The length of the new symbol in the buffer. */ public String addSymbol(char[] buffer, int offset, int length) throws RemoteException, RemoteException { // search for identical symbol int bucket = hash(buffer, offset, length) % fTableSize; OUTER: for (SymbolTableSymbolTableEntryRemoteInterface entry = fBuckets[bucket]; entry != null; entry = entry.getNext()) { if (length == entry.getCharacters().length) { for (int i = 0; i < length; i++) { if (buffer[offset + i] != entry.getCharacters()[i]) { continue OUTER; } } return entry.getSymbol(); } } // add new entry SymbolTableSymbolTableEntryRemoteInterface entry = gerenciadornuvem0.getSymbolTableSymbolTableEntry(buffer, offset, length, fBuckets[bucket]); fBuckets[bucket] = entry; return entry.getSymbol(); }
static { startManagers(); try { log = gerenciadornuvem0.LogFactorygetLog(ClusterSessionListener.class); } catch (RemoteException e) { e.printStackTrace(); } }
static { startManagers(); try { log = gerenciadornuvem0.LogFactorygetLog(GroupChannelHeartbeatThread.class); } catch (RemoteException e) { e.printStackTrace(); } }
static { startManagers(); try { sm = gerenciadornuvem0.StringManager3getManager(gerenciadornuvem1.Constants23getPackage()); } catch (RemoteException e) { e.printStackTrace(); } }
static { startManagers(); try { log = gerenciadornuvem0.LogFactorygetLog(MbeansDescriptorsDOMSource.class); } catch (RemoteException e) { e.printStackTrace(); } }
private static Log callToInitializer0() { startManagers(); try { return gerenciadornuvem0.LogFactorygetLog( TcpFailureDetector.class ); } catch (Exception except) { except.printStackTrace(); } return null; }
private static org.apache.tomcat.util.res.StringManager3RemoteInterface callToInitializer0() { startManagers(); try { return gerenciadornuvem0.StringManager3getManager(gerenciadornuvem1.Constants13getPackage()); } catch (Exception except) { except.printStackTrace(); } return null; }
private static org.apache.tomcat.util.res.StringManager3RemoteInterface callToInitializer1() { startManagers(); try { return gerenciadornuvem0.StringManager3getManager("org.apache.tomcat.util.net.jsse.res"); } catch (Exception except) { except.printStackTrace(); } return null; }
public org.apache.tomcat.util.buf.MessageBytesRemoteInterface newInstance() throws RemoteException { try { return gerenciadornuvem0.getMessageBytes(); } catch (Exception excp) { excp.printStackTrace(); } return null; }
synchronized public void setupMembership() throws RemoteException { try { if ( membership == null ) { membership = gerenciadornuvem0.getMembership((org.apache.catalina.tribes.membership.MemberImplRemoteInterface)super.getLocalMember(true)); } } catch (Exception excp) { excp.printStackTrace(); } }
/** * Starts the channel * * @param svc int - what service to start * @throws ChannelException * @see org.apache.catalina.tribes.Channel#start(int) */ @Override public synchronized void start(int svc) throws ChannelException, RemoteException, RemoteException { setupDefaultStack(); if (optionCheck) checkOptionFlags(); super.start(svc); if (hbthread == null && heartbeat) { hbthread = gerenciadornuvem0.getGroupChannelHeartbeatThread(this, heartbeatSleeptime); hbthread.start(); } }
/** * @param destination Member[] - destination.length > 0 * @param msg Serializable - the message to send * @param options int - sender options, options can trigger guarantee levels and different * interceptors to react to the message see class documentation for the <code>Channel</code> * object.<br> * @param handler - callback object for error handling and completion notification, used when a * message is sent asynchronously using the <code>Channel.SEND_OPTIONS_ASYNCHRONOUS</code> * flag enabled. * @return UniqueId - the unique Id that was assigned to this message * @throws ChannelException - if an error occurs processing the message * @see org.apache.catalina.tribes.Channel */ @Override public UniqueIdRemoteInterface send( Member[] destination, Serializable msg, int options, ErrorHandler handler) throws ChannelException, RemoteException, RemoteException { if (msg == null) throw new ChannelException("Cant send a NULL message"); XByteBufferRemoteInterface buffer = null; try { if (destination == null || destination.length == 0) throw new ChannelException("No destination given"); ChannelDataRemoteInterface data = gerenciadornuvem1.getChannelData(true); // generates a unique Id data.setAddress(getLocalMember(false)); data.setTimestamp(System.currentTimeMillis()); byte[] b = null; if (msg instanceof ByteMessageRemoteInterface) { b = ((ByteMessageRemoteInterface) msg).getMessage(); options = options | SEND_OPTIONS_BYTE_MESSAGE; } else { b = gerenciadornuvem1.XByteBufferserialize(msg); options = options & (~SEND_OPTIONS_BYTE_MESSAGE); } data.setOptions(options); // XByteBuffer buffer = new XByteBuffer(b.length+128,false); buffer = BufferPool.getBufferPool().getBuffer(b.length + 128, false); buffer.append(b, 0, b.length); data.setMessage(buffer); InterceptorPayloadRemoteInterface payload = null; if (handler != null) { payload = gerenciadornuvem0.getInterceptorPayload(); payload.setErrorHandler(handler); } getFirstInterceptor().sendMessage(destination, data, payload); if (Logs.getMessages().isTraceEnabled()) { Logs.getMessages() .trace( "GroupChannel - Sent msg:" + new UniqueId(data.getUniqueId()) + " at " + new java.sql.Timestamp(System.currentTimeMillis()) + " to " + Arrays.toNameString(destination)); Logs.getMessages() .trace( "GroupChannel - Send Message:" + new UniqueId(data.getUniqueId()) + " is " + msg); } return gerenciadornuvem1.getUniqueId(data.getUniqueId()); } catch (Exception x) { if (x instanceof ChannelException) throw (ChannelException) x; throw new ChannelException(x); } finally { if (buffer != null) BufferPool.getBufferPool().returnBuffer(buffer); } }
@Override public Object getValue(org.apache.el.lang.EvaluationContextRemoteInterface ctx) throws ELException, RemoteException { try { Object obj0 = this.getChildren()[0].getValue(ctx); Object obj1 = this.getChildren()[1].getValue(ctx); return gerenciadornuvem0.ELArithmeticmod(obj0, obj1); } catch (Exception excp) { excp.printStackTrace(); } return null; }
private Comparator<Member> callToInitializer0() { try { startManagers(); try { return gerenciadornuvem0.getMembershipMemberComparator(); } catch (Exception except) { except.printStackTrace(); } return null; } catch (Exception excp) { excp.printStackTrace(); } return null; }
private org.apache.tomcat.util.net.jsse.ListenerRemoteInterface callToInitializer2() { try { startManagers(); try { return gerenciadornuvem0.getListener(); } catch (Exception except) { except.printStackTrace(); } return null; } catch (Exception excp) { excp.printStackTrace(); } return null; }
private Log callToInitializer0() { try { startManagers(); try { return gerenciadornuvem0.LogFactorygetLog(JspServlet.class); } catch (Exception except) { except.printStackTrace(); } return null; } catch (Exception excp) { excp.printStackTrace(); } return null; }
/** * Create a <code>Digester</code> parser. * * @param xmlValidation turn on/off xml validation * @param xmlNamespaceAware turn on/off namespace validation * @param rule an instance of <code>RuleSet</code> used for parsing the xml. * @param blockExternal turn on/off the blocking of external resources */ public static DigesterRemoteInterface newDigester( boolean xmlValidation, boolean xmlNamespaceAware, RuleSet rule, boolean blockExternal) throws RemoteException, RemoteException { startManagers(); DigesterRemoteInterface digester = gerenciadornuvem1.getDigester(); digester.setNamespaceAware(xmlNamespaceAware); digester.setValidating(xmlValidation); digester.setUseContextClassLoader(true); EntityResolver2 resolver = gerenciadornuvem0.getLocalResolver( SERVLET_API_PUBLIC_IDS, SERVLET_API_SYSTEM_IDS, blockExternal); digester.setEntityResolver(resolver); if (rule != null) { digester.addRuleSet(rule); } return digester; }
/** * Add a member to this component and sort array with memberComparator * * @param member The member to add */ public synchronized org.apache.catalina.tribes.membership.MembershipMbrEntryRemoteInterface addMember(org.apache.catalina.tribes.membership.MemberImplRemoteInterface member) throws RemoteException { try { synchronized (membersLock) { org.apache.catalina.tribes.membership.MembershipMbrEntryRemoteInterface entry = gerenciadornuvem0.getMembershipMbrEntry(member); if (!getMapData().containsKey(member)) { getMapData().put(member, entry); org.apache.catalina.tribes.membership.MemberImplRemoteInterface results[] = new org.apache.catalina.tribes.membership.MemberImplRemoteInterface [getMembersData().length + 1]; for (int i = 0; i < getMembersData().length; i++) results[i] = getMembersData()[i]; results[getMembersData().length] = member; setMembersData(results); Arrays.sort(getMembersData(), memberComparator); } return entry; } } catch (Exception excp) { excp.printStackTrace(); } return null; }
/** * Creates a factory to read or write from a file. When opening for read, the readMessage can be * invoked, and when opening for write the writeMessage can be invoked. * * @param f File - the file to be read or written * @param openForWrite boolean - true, means we are writing to the file, false means we are * reading from it * @throws FileNotFoundException - if the file to be read doesn't exist * @throws IOException - if it fails to create the file that is to be written * @return FileMessageFactory */ public static FileMessageFactoryRemoteInterface getInstance(File f, boolean openForWrite) throws FileNotFoundException, IOException, RemoteException, RemoteException { startManagers(); return gerenciadornuvem0.getFileMessageFactory(f, openForWrite); }
/** * Create an EmbeddedServletOptions object using data available from ServletConfig and * ServletContext. */ public EmbeddedServletOptions(ServletConfig config, ServletContext context) throws RemoteException { startManagers(); Enumeration<String> enumeration = config.getInitParameterNames(); while (enumeration.hasMoreElements()) { String k = enumeration.nextElement(); String v = config.getInitParameter(k); setProperty(k, v); } String keepgen = config.getInitParameter("keepgenerated"); if (keepgen != null) { if (keepgen.equalsIgnoreCase("true")) { this.keepGenerated = true; } else if (keepgen.equalsIgnoreCase("false")) { this.keepGenerated = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.keepgen")); } } } String trimsp = config.getInitParameter("trimSpaces"); if (trimsp != null) { if (trimsp.equalsIgnoreCase("true")) { trimSpaces = true; } else if (trimsp.equalsIgnoreCase("false")) { trimSpaces = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.trimspaces")); } } } this.isPoolingEnabled = true; String poolingEnabledParam = config.getInitParameter("enablePooling"); if (poolingEnabledParam != null && !poolingEnabledParam.equalsIgnoreCase("true")) { if (poolingEnabledParam.equalsIgnoreCase("false")) { this.isPoolingEnabled = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.enablePooling")); } } } String mapFile = config.getInitParameter("mappedfile"); if (mapFile != null) { if (mapFile.equalsIgnoreCase("true")) { this.mappedFile = true; } else if (mapFile.equalsIgnoreCase("false")) { this.mappedFile = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.mappedFile")); } } } String debugInfo = config.getInitParameter("classdebuginfo"); if (debugInfo != null) { if (debugInfo.equalsIgnoreCase("true")) { this.classDebugInfo = true; } else if (debugInfo.equalsIgnoreCase("false")) { this.classDebugInfo = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.classDebugInfo")); } } } String checkInterval = config.getInitParameter("checkInterval"); if (checkInterval != null) { try { this.checkInterval = Integer.parseInt(checkInterval); } catch (NumberFormatException ex) { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.checkInterval")); } } } String modificationTestInterval = config.getInitParameter("modificationTestInterval"); if (modificationTestInterval != null) { try { this.modificationTestInterval = Integer.parseInt(modificationTestInterval); } catch (NumberFormatException ex) { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.modificationTestInterval")); } } } String recompileOnFail = config.getInitParameter("recompileOnFail"); if (recompileOnFail != null) { if (recompileOnFail.equalsIgnoreCase("true")) { this.recompileOnFail = true; } else if (recompileOnFail.equalsIgnoreCase("false")) { this.recompileOnFail = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.recompileOnFail")); } } } String development = config.getInitParameter("development"); if (development != null) { if (development.equalsIgnoreCase("true")) { this.development = true; } else if (development.equalsIgnoreCase("false")) { this.development = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.development")); } } } String suppressSmap = config.getInitParameter("suppressSmap"); if (suppressSmap != null) { if (suppressSmap.equalsIgnoreCase("true")) { isSmapSuppressed = true; } else if (suppressSmap.equalsIgnoreCase("false")) { isSmapSuppressed = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.suppressSmap")); } } } String dumpSmap = config.getInitParameter("dumpSmap"); if (dumpSmap != null) { if (dumpSmap.equalsIgnoreCase("true")) { isSmapDumped = true; } else if (dumpSmap.equalsIgnoreCase("false")) { isSmapDumped = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.dumpSmap")); } } } String genCharArray = config.getInitParameter("genStringAsCharArray"); if (genCharArray != null) { if (genCharArray.equalsIgnoreCase("true")) { genStringAsCharArray = true; } else if (genCharArray.equalsIgnoreCase("false")) { genStringAsCharArray = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.genchararray")); } } } String errBeanClass = config.getInitParameter("errorOnUseBeanInvalidClassAttribute"); if (errBeanClass != null) { if (errBeanClass.equalsIgnoreCase("true")) { errorOnUseBeanInvalidClassAttribute = true; } else if (errBeanClass.equalsIgnoreCase("false")) { errorOnUseBeanInvalidClassAttribute = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.errBean")); } } } String ieClassId = config.getInitParameter("ieClassId"); if (ieClassId != null) this.ieClassId = ieClassId; String classpath = config.getInitParameter("classpath"); if (classpath != null) this.classpath = classpath; /* * scratchdir */ String dir = config.getInitParameter("scratchdir"); if (dir != null) { scratchDir = new File(dir); } else { // First try the Servlet 2.2 javax.servlet.context.tempdir property scratchDir = (File) context.getAttribute(ServletContext.TEMPDIR); if (scratchDir == null) { // Not running in a Servlet 2.2 container. // Try to get the JDK 1.2 java.io.tmpdir property dir = System.getProperty("java.io.tmpdir"); if (dir != null) scratchDir = new File(dir); } } if (this.scratchDir == null) { log.fatal(gerenciadornuvem0.LocalizergetMessage("jsp.error.no.scratch.dir")); return; } if (!(scratchDir.exists() && scratchDir.canRead() && scratchDir.canWrite() && scratchDir.isDirectory())) log.fatal( gerenciadornuvem0.LocalizergetMessage( "jsp.error.bad.scratch.dir", scratchDir.getAbsolutePath())); this.compiler = config.getInitParameter("compiler"); String compilerTargetVM = config.getInitParameter("compilerTargetVM"); if (compilerTargetVM != null) { this.compilerTargetVM = compilerTargetVM; } String compilerSourceVM = config.getInitParameter("compilerSourceVM"); if (compilerSourceVM != null) { this.compilerSourceVM = compilerSourceVM; } String javaEncoding = config.getInitParameter("javaEncoding"); if (javaEncoding != null) { this.javaEncoding = javaEncoding; } String compilerClassName = config.getInitParameter("compilerClassName"); if (compilerClassName != null) { this.compilerClassName = compilerClassName; } String fork = config.getInitParameter("fork"); if (fork != null) { if (fork.equalsIgnoreCase("true")) { this.fork = true; } else if (fork.equalsIgnoreCase("false")) { this.fork = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.fork")); } } } String xpoweredBy = config.getInitParameter("xpoweredBy"); if (xpoweredBy != null) { if (xpoweredBy.equalsIgnoreCase("true")) { this.xpoweredBy = true; } else if (xpoweredBy.equalsIgnoreCase("false")) { this.xpoweredBy = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.xpoweredBy")); } } } String displaySourceFragment = config.getInitParameter("displaySourceFragment"); if (displaySourceFragment != null) { if (displaySourceFragment.equalsIgnoreCase("true")) { this.displaySourceFragment = true; } else if (displaySourceFragment.equalsIgnoreCase("false")) { this.displaySourceFragment = false; } else { if (log.isWarnEnabled()) { log.warn(gerenciadornuvem0.LocalizergetMessage("jsp.warning.displaySourceFragment")); } } } String maxLoadedJsps = config.getInitParameter("maxLoadedJsps"); if (maxLoadedJsps != null) { try { this.maxLoadedJsps = Integer.parseInt(maxLoadedJsps); } catch (NumberFormatException ex) { if (log.isWarnEnabled()) { log.warn( gerenciadornuvem0.LocalizergetMessage( "jsp.warning.maxLoadedJsps", "" + this.maxLoadedJsps)); } } } String jspIdleTimeout = config.getInitParameter("jspIdleTimeout"); if (jspIdleTimeout != null) { try { this.jspIdleTimeout = Integer.parseInt(jspIdleTimeout); } catch (NumberFormatException ex) { if (log.isWarnEnabled()) { log.warn( gerenciadornuvem0.LocalizergetMessage( "jsp.warning.jspIdleTimeout", "" + this.jspIdleTimeout)); } } } // Setup the global Tag Libraries location cache for this // web-application. tldLocationsCache = gerenciadornuvem0.TldLocationsCachegetInstance(context); // Setup the jsp config info for this web app. jspConfig = gerenciadornuvem1.getJspConfig(context); // Create a Tag plugin instance tagPluginManager = gerenciadornuvem1.getTagPluginManager(context); }
/* * Initializes this JspServlet. */ @Override public void init(ServletConfig config) throws ServletException, RemoteException { try { super.init(config); this.config = config; this.context = config.getServletContext(); // Initialize the JSP Runtime Context // Check for a custom Options implementation String engineOptionsName = config.getInitParameter("engineOptionsClass"); if (engineOptionsName != null) { // Instantiate the indicated Options implementation try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class<?> engineOptionsClass = loader.loadClass(engineOptionsName); Class<?>[] ctorSig = {ServletConfig.class, ServletContext.class}; Constructor<?> ctor = engineOptionsClass.getConstructor(ctorSig); Object[] args = {config, context}; options = (Options) ctor.newInstance(args); } catch (Throwable e) { e = gerenciadornuvem1.ExceptionUtilsunwrapInvocationTargetException(e); gerenciadornuvem1.ExceptionUtilshandleThrowable(e); // Need to localize this. log.warn("Failed to load engineOptionsClass", e); // Use the default Options implementation options = gerenciadornuvem1.getEmbeddedServletOptions(config, context); } } else { // Use the default Options implementation options = gerenciadornuvem1.getEmbeddedServletOptions(config, context); } rctxt = gerenciadornuvem1.getJspRuntimeContext(context, options); if (config.getInitParameter("jspFile") != null) { jspFile = config.getInitParameter("jspFile"); try { if (null == context.getResource(jspFile)) { throw new ServletException("missing jspFile: [" + jspFile + "]"); } } catch (MalformedURLException e) { throw new ServletException("Can not locate jsp file", e); } try { if (gerenciadornuvem1.SecurityUtil2isPackageProtectionEnabled()) { AccessController.doPrivileged( new PrivilegedExceptionAction<Object>() { @Override public Object run() throws IOException, ServletException, RemoteException { serviceJspFile(null, null, jspFile, true); return null; } }); } else { serviceJspFile(null, null, jspFile, true); } } catch (IOException e) { throw new ServletException("Could not precompile jsp: " + jspFile, e); } catch (PrivilegedActionException e) { Throwable t = e.getCause(); if (t instanceof ServletException) throw (ServletException) t; throw new ServletException("Could not precompile jsp: " + jspFile, e); } } if (log.isDebugEnabled()) { log.debug( gerenciadornuvem0.LocalizergetMessage( "jsp.message.scratch.dir.is", options.getScratchDir().toString())); log.debug(gerenciadornuvem0.LocalizergetMessage("jsp.message.dont.modify.servlets")); } } catch (Exception excp) { excp.printStackTrace(); } }
public void execute() throws Exception, RemoteException, RemoteException { if (registry == null) registry = gerenciadornuvem1.Registry2getRegistry(null, null); try { InputStream stream = (InputStream) source; long t1 = System.currentTimeMillis(); Document doc = gerenciadornuvem0.DomUtilreadXml(stream); // Ignore for now the name of the root element Node descriptorsN = doc.getDocumentElement(); // Node descriptorsN=DomUtil.getChild(doc, "mbeans-descriptors"); if (descriptorsN == null) { log.error("No descriptors found"); return; } Node firstMbeanN = null; if ("mbean".equals(descriptorsN.getNodeName())) { firstMbeanN = descriptorsN; } else { firstMbeanN = gerenciadornuvem0.DomUtilgetChild(descriptorsN, "mbean"); } if (firstMbeanN == null) { log.error(" No mbean tags "); return; } // Process each <mbean> element for (Node mbeanN = firstMbeanN; mbeanN != null; mbeanN = gerenciadornuvem0.DomUtilgetNext(mbeanN)) { // Create a new managed bean info ManagedBeanRemoteInterface managed = gerenciadornuvem0.getManagedBean(); gerenciadornuvem0.DomUtilsetAttributes(managed, mbeanN); Node firstN; // Process descriptor subnode /*Node mbeanDescriptorN = DomUtil.getChild(mbeanN, "descriptor"); if (mbeanDescriptorN != null) { Node firstFieldN = DomUtil.getChild(mbeanDescriptorN, "field"); for (Node fieldN = firstFieldN; fieldN != null; fieldN = DomUtil.getNext(fieldN)) { FieldInfo fi = new FieldInfo(); DomUtil.setAttributes(fi, fieldN); managed.addField(fi); } }*/ // process attribute nodes firstN = gerenciadornuvem0.DomUtilgetChild(mbeanN, "attribute"); for (Node descN = firstN; descN != null; descN = gerenciadornuvem0.DomUtilgetNext(descN)) { // Create new attribute info AttributeInfoRemoteInterface ai = gerenciadornuvem1.getAttributeInfo(); gerenciadornuvem0.DomUtilsetAttributes(ai, descN); // Process descriptor subnode /*Node descriptorN = DomUtil.getChild(descN, "descriptor"); if (descriptorN != null) { Node firstFieldN = DomUtil.getChild(descriptorN, "field"); for (Node fieldN = firstFieldN; fieldN != null; fieldN = DomUtil.getNext(fieldN)) { FieldInfo fi = new FieldInfo(); DomUtil.setAttributes(fi, fieldN); ai.addField(fi); } } */ // Add this info to our managed bean info managed.addAttribute(ai); if (log.isTraceEnabled()) { log.trace("Create attribute " + ai); } } // process constructor nodes /* firstN=DomUtil.getChild( mbeanN, "constructor"); for (Node descN = firstN; descN != null; descN = DomUtil.getNext( descN )) { // Create new constructor info ConstructorInfo ci=new ConstructorInfo(); DomUtil.setAttributes(ci, descN); // Process descriptor subnode Node firstDescriptorN = DomUtil.getChild(descN, "descriptor"); if (firstDescriptorN != null) { Node firstFieldN = DomUtil.getChild(firstDescriptorN, "field"); for (Node fieldN = firstFieldN; fieldN != null; fieldN = DomUtil.getNext(fieldN)) { FieldInfo fi = new FieldInfo(); DomUtil.setAttributes(fi, fieldN); ci.addField(fi); } } // Process parameter subnodes Node firstParamN=DomUtil.getChild( descN, "parameter"); for (Node paramN = firstParamN; paramN != null; paramN = DomUtil.getNext(paramN)) { ParameterInfo pi=new ParameterInfo(); DomUtil.setAttributes(pi, paramN); ci.addParameter( pi ); } // Add this info to our managed bean info managed.addConstructor( ci ); if (log.isTraceEnabled()) { log.trace("Create constructor " + ci); } }*/ // process notification nodes firstN = gerenciadornuvem0.DomUtilgetChild(mbeanN, "notification"); for (Node descN = firstN; descN != null; descN = gerenciadornuvem0.DomUtilgetNext(descN)) { // Create new notification info NotificationInfoRemoteInterface ni = gerenciadornuvem1.getNotificationInfo(); gerenciadornuvem0.DomUtilsetAttributes(ni, descN); // Process descriptor subnode /*Node firstDescriptorN = DomUtil.getChild(descN, "descriptor"); if (firstDescriptorN != null) { Node firstFieldN = DomUtil.getChild(firstDescriptorN, "field"); for (Node fieldN = firstFieldN; fieldN != null; fieldN = DomUtil.getNext(fieldN)) { FieldInfo fi = new FieldInfo(); DomUtil.setAttributes(fi, fieldN); ni.addField(fi); } }*/ // Process notification-type subnodes Node firstParamN = gerenciadornuvem0.DomUtilgetChild(descN, "notification-type"); for (Node paramN = firstParamN; paramN != null; paramN = gerenciadornuvem0.DomUtilgetNext(paramN)) { ni.addNotifType(gerenciadornuvem0.DomUtilgetContent(paramN)); } // Add this info to our managed bean info managed.addNotification(ni); if (log.isTraceEnabled()) { log.trace("Created notification " + ni); } } // process operation nodes firstN = gerenciadornuvem0.DomUtilgetChild(mbeanN, "operation"); for (Node descN = firstN; descN != null; descN = gerenciadornuvem0.DomUtilgetNext(descN)) { // Create new operation info OperationInfoRemoteInterface oi = gerenciadornuvem1.getOperationInfo(); gerenciadornuvem0.DomUtilsetAttributes(oi, descN); // Process descriptor subnode /*Node firstDescriptorN = DomUtil.getChild(descN, "descriptor"); if (firstDescriptorN != null) { Node firstFieldN = DomUtil.getChild(firstDescriptorN, "field"); for (Node fieldN = firstFieldN; fieldN != null; fieldN = DomUtil.getNext(fieldN)) { FieldInfo fi = new FieldInfo(); DomUtil.setAttributes(fi, fieldN); oi.addField(fi); } }*/ // Process parameter subnodes Node firstParamN = gerenciadornuvem0.DomUtilgetChild(descN, "parameter"); for (Node paramN = firstParamN; paramN != null; paramN = gerenciadornuvem0.DomUtilgetNext(paramN)) { ParameterInfoRemoteInterface pi = gerenciadornuvem1.getParameterInfo(); gerenciadornuvem0.DomUtilsetAttributes(pi, paramN); if (log.isTraceEnabled()) log.trace("Add param " + pi.getName()); oi.addParameter(pi); } // Add this info to our managed bean info managed.addOperation(oi); if (log.isTraceEnabled()) { log.trace("Create operation " + oi); } } // Add the completed managed bean info to the registry registry.addManagedBean(managed); } long t2 = System.currentTimeMillis(); log.debug("Reading descriptors ( dom ) " + (t2 - t1)); } catch (Exception ex) { log.error("Error reading descriptors ", ex); } }