All Downloads are FREE. Search and download functionalities are using the official Maven repository.

system.web.hosting.HostingEnvironment Maven / Gradle / Ivy

/*
 *  MIT License
 *
 *  Copyright (c) 2024 MASES s.r.l.
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in all
 *  copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *  SOFTWARE.
 */

/**************************************************************************************
 * 
 *      This code was generated from a template using JCOReflector v. 1.15.0.0
 * 
 *      Manual changes to this file may cause unexpected behavior in your application.
 *      Manual changes to this file will be overwritten if the code is regenerated.
 * 
 *************************************************************************************/

package system.web.hosting;

import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;

// Import section
import system.MarshalByRefObject;
import system.IDisposable;
import system.IDisposableImplementation;
import system.web.hosting.IRegisteredObject;
import system.web.hosting.IRegisteredObjectImplementation;
import system.web.hosting.VirtualPathProvider;
import system.web.ApplicationShutdownReason;
import system.web.caching.Cache;
import system.web.hosting.ApplicationMonitors;
import system.web.hosting.IApplicationHost;
import system.web.hosting.IApplicationHostImplementation;


/**
 * The base .NET class managing System.Web.Hosting.HostingEnvironment, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
 * 

* * .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Web.Hosting.HostingEnvironment *

* * Powered by JCOBridge: more info at https://www.jcobridge.com * * @author MASES s.r.l https://masesgroup.com * @version 1.15.0.0 */ public class HostingEnvironment extends MarshalByRefObject { /** * Fully assembly qualified name: System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a */ public static final String assemblyFullName = "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; /** * Assembly name: System.Web */ public static final String assemblyShortName = "System.Web"; /** * Qualified class name: System.Web.Hosting.HostingEnvironment */ public static final String className = "System.Web.Hosting.HostingEnvironment"; static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName); /** * The type managed from JCOBridge. See {@link JCType} */ public static JCType classType = createType(); static JCEnum enumInstance = null; JCObject classInstance = null; static JCType createType() { try { String classToCreate = className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); if (JCOReflector.getDebug()) JCOReflector.writeLog("Creating %s", classToCreate); JCType typeCreated = bridge.GetType(classToCreate); if (JCOReflector.getDebug()) JCOReflector.writeLog("Created: %s", (typeCreated != null) ? typeCreated.toString() : "Returned null value"); return typeCreated; } catch (JCException e) { JCOReflector.writeLog(e); return null; } } void addReference(String ref) throws Throwable { try { bridge.AddReference(ref); } catch (JCNativeException jcne) { throw translateException(jcne); } } /** * Internal constructor. Use with caution */ public HostingEnvironment(java.lang.Object instance) throws Throwable { super(instance); if (instance instanceof JCObject) { classInstance = (JCObject) instance; } else throw new Exception("Cannot manage object, it is not a JCObject"); } public String getJCOAssemblyName() { return assemblyFullName; } public String getJCOClassName() { return className; } public String getJCOObjectName() { return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); } public java.lang.Object getJCOInstance() { return classInstance; } public void setJCOInstance(JCObject instance) { classInstance = instance; super.setJCOInstance(classInstance); } public JCType getJCOType() { return classType; } /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link HostingEnvironment}, a cast assert is made to check if types are compatible. * @param from {@link IJCOBridgeReflected} instance to be casted * @return {@link HostingEnvironment} instance * @throws java.lang.Throwable in case of error during cast operation */ public static HostingEnvironment cast(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new HostingEnvironment(from.getJCOInstance()); } // Constructors section public HostingEnvironment() throws Throwable, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.FormatException, system.NotImplementedException, system.NotSupportedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.threading.AbandonedMutexException, system.web.HttpException, system.security.SecurityException, system.configuration.ConfigurationErrorsException, system.threading.SemaphoreFullException, system.NullReferenceException, system.MemberAccessException, system.configuration.provider.ProviderException, system.OverflowException, system.runtime.remoting.RemotingException, system.MulticastNotSupportedException { try { // add reference to assemblyName.dll file addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); setJCOInstance((JCObject)classType.NewObject()); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Methods section public static IDisposable Impersonate() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotImplementedException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.web.HttpException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objImpersonate = (JCObject)classType.Invoke("Impersonate"); return new IDisposableImplementation(objImpersonate); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static IDisposable SetCultures() throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.web.HttpException, system.InvalidOperationException, system.configuration.provider.ProviderException, system.configuration.ConfigurationErrorsException, system.OutOfMemoryException, system.globalization.CultureNotFoundException, system.TypeInitializationException, system.TypeLoadException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotSupportedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objSetCultures = (JCObject)classType.Invoke("SetCultures"); return new IDisposableImplementation(objSetCultures); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static IDisposable SetCultures(java.lang.String virtualPath) throws Throwable, system.ArgumentNullException, system.web.HttpException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.ArgumentException, system.globalization.CultureNotFoundException, system.InvalidOperationException, system.configuration.provider.ProviderException, system.configuration.ConfigurationErrorsException, system.TypeInitializationException, system.TypeLoadException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotSupportedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objSetCultures = (JCObject)classType.Invoke("SetCultures", virtualPath); return new IDisposableImplementation(objSetCultures); } catch (JCNativeException jcne) { throw translateException(jcne); } } public NetObject InitializeLifetimeService() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objInitializeLifetimeService = (JCObject)classInstance.Invoke("InitializeLifetimeService"); return new NetObject(objInitializeLifetimeService); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String MapPath(java.lang.String virtualPath) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotImplementedException, system.globalization.CultureNotFoundException, system.IndexOutOfRangeException, system.ArgumentOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.web.HttpException, system.OutOfMemoryException, system.NotSupportedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (java.lang.String)classType.Invoke("MapPath", virtualPath); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void DecrementBusyCount() throws Throwable, system.ArgumentOutOfRangeException, system.ArgumentException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("DecrementBusyCount"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void IncrementBusyCount() throws Throwable { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("IncrementBusyCount"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void InitiateShutdown() throws Throwable, system.ArgumentException, system.IndexOutOfRangeException, system.security.SecurityException, system.ArgumentNullException, system.NotSupportedException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.FormatException, system.web.HttpException, system.configuration.ConfigurationErrorsException, system.NotImplementedException, system.configuration.ConfigurationException, system.ObjectDisposedException, system.threading.AbandonedMutexException, system.threading.SemaphoreFullException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("InitiateShutdown"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void MessageReceived() throws Throwable, system.ArgumentOutOfRangeException, system.ArgumentException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("MessageReceived"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void RegisterObject(IRegisteredObject obj) throws Throwable, system.ArgumentException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.FormatException, system.InvalidOperationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("RegisterObject", obj == null ? null : obj.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void RegisterVirtualPathProvider(VirtualPathProvider virtualPathProvider) throws Throwable, system.InvalidOperationException, system.ArgumentNullException, system.ArgumentException, system.IndexOutOfRangeException, system.NotSupportedException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.PathTooLongException, system.io.DriveNotFoundException, system.OperationCanceledException, system.resources.MissingManifestResourceException, system.ArgumentOutOfRangeException, system.xml.XmlException, system.configuration.ConfigurationErrorsException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("RegisterVirtualPathProvider", virtualPathProvider == null ? null : virtualPathProvider.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void UnregisterObject(IRegisteredObject obj) throws Throwable, system.ArgumentException, system.ArgumentNullException, system.ObjectDisposedException, system.threading.AbandonedMutexException, system.IndexOutOfRangeException, system.security.SecurityException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.FormatException, system.InvalidOperationException, system.web.HttpException, system.configuration.ConfigurationErrorsException, system.resources.MissingManifestResourceException, system.configuration.ConfigurationException, system.threading.SemaphoreFullException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("UnregisterObject", obj == null ? null : obj.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Properties section public static boolean getInClientBuildManager() throws Throwable { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (boolean)classType.Get("InClientBuildManager"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static boolean getIsDevelopmentEnvironment() throws Throwable, system.ArgumentNullException, system.NullReferenceException, system.ArgumentOutOfRangeException, system.ArgumentException, system.globalization.CultureNotFoundException, system.IndexOutOfRangeException, system.io.PathTooLongException, system.MemberAccessException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (boolean)classType.Get("IsDevelopmentEnvironment"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static boolean getIsHosted() throws Throwable { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (boolean)classType.Get("IsHosted"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static int getMaxConcurrentRequestsPerCPU() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.PlatformNotSupportedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (int)classType.Get("MaxConcurrentRequestsPerCPU"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void setMaxConcurrentRequestsPerCPU(int MaxConcurrentRequestsPerCPU) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.PlatformNotSupportedException, system.FormatException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Set("MaxConcurrentRequestsPerCPU", MaxConcurrentRequestsPerCPU); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static int getMaxConcurrentThreadsPerCPU() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.PlatformNotSupportedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (int)classType.Get("MaxConcurrentThreadsPerCPU"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void setMaxConcurrentThreadsPerCPU(int MaxConcurrentThreadsPerCPU) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.PlatformNotSupportedException, system.FormatException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Set("MaxConcurrentThreadsPerCPU", MaxConcurrentThreadsPerCPU); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static NetException getInitializationException() throws Throwable { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject val = (JCObject)classType.Get("InitializationException"); return new NetException(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String getApplicationID() throws Throwable, system.ArgumentException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (java.lang.String)classType.Get("ApplicationID"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String getApplicationPhysicalPath() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.IndexOutOfRangeException, system.globalization.CultureNotFoundException, system.InvalidOperationException, system.NotSupportedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (java.lang.String)classType.Get("ApplicationPhysicalPath"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String getApplicationVirtualPath() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.web.HttpException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (java.lang.String)classType.Get("ApplicationVirtualPath"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String getSiteName() throws Throwable, system.ArgumentException, system.InvalidOperationException, system.ArgumentNullException, system.NotImplementedException, system.globalization.CultureNotFoundException, system.IndexOutOfRangeException, system.ArgumentOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (java.lang.String)classType.Get("SiteName"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static ApplicationShutdownReason getShutdownReason() throws Throwable { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject val = (JCObject)classType.Get("ShutdownReason"); return new ApplicationShutdownReason(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static Cache getCache() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.IndexOutOfRangeException, system.web.HttpException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject val = (JCObject)classType.Get("Cache"); return new Cache(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static ApplicationMonitors getApplicationMonitors() throws Throwable { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject val = (JCObject)classType.Get("ApplicationMonitors"); return new ApplicationMonitors(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static IApplicationHost getApplicationHost() throws Throwable { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject val = (JCObject)classType.Get("ApplicationHost"); return new IApplicationHostImplementation(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static VirtualPathProvider getVirtualPathProvider() throws Throwable, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.ArgumentException, system.ObjectDisposedException, system.threading.AbandonedMutexException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject val = (JCObject)classType.Get("VirtualPathProvider"); return new VirtualPathProvider(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Instance Events section }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy