### Parser Configuration Examples Source: https://github.com/eclipse-ee4j/orb/blob/master/orbmain/src/main/java/com/sun/corba/ee/impl/orb/parsing_combinators.txt Provides examples of parser configurations from a parser table, mapping configuration keys to their types and transformations. It includes examples like `giopVersion` with mapping and FSR, `giopFragmentSize` with modulo and min operations, and `giop11BuffMgr` with map construction. ```pseudocode From parser table: debugFlags string ORBInitialHost string ORBInitialPort integer ORBServerHost string ORBServerPort integer orbId string highWaterMark integer lowWaterMark integer etc. giopVersion construct(GIOPVersion.class):map(integer):list('.') giopFragmentSize mod(ORBConstants.GIOP_FRAGMENT_DIVISOR):min(ORBConstants.GIOP_FRAGMENT_SIZE):integer Lisp notation: parse((mod ORBConstants.GIOP_FRAGMENT_DIVISOR) (min ...) (integer)) giop11BuffMgr makeMap(map) where map is constructed in java with map.get("GROW") = Integer(0) map.get("CLCT") = Integer(1) map.get("STRM") = Integer(2) giopTargetAddressPreference intToShort:integerRange(0,3) giopAddressDisposition another map variant charData construct(CodeSetComponentInfo.class):string ``` -------------------------------- ### Helper Scripts for GlassFish Installation and Management Source: https://github.com/eclipse-ee4j/orb/blob/master/iiop-folb-dev-test/README.html Lists the utility scripts assumed to be available in the 'scripts' directory for managing GlassFish installations and modules. These scripts automate tasks like killing processes, installing ORB components, and deploying GlassFish. ```bash # killgf: kill all GF processes on a machine # installorb: install the GF 3.1 ORB into /glassfish4/glassfish/modules # installgfv3: installs GF 3.1 into # installgforb: installs GF 3.1 orb/* modules into /glassfish4/glassfish/modules # installgfnaming: installs GF 3.1 common/glassfish-naming module into /glassfish4/glassfish/modules ``` -------------------------------- ### Environment Variables for GlassFish Setup Source: https://github.com/eclipse-ee4j/orb/blob/master/iiop-folb-dev-test/README.html Lists the essential environment variables that need to be set for configuring and running the GlassFish 3.1.x environment. These variables define paths to GlassFish installations, JDK, and workspace directories. ```bash # S1AS_HOME: must be set to /glassfish4/glassfish # JAVA_HOME: must be set such that $JAVA_HOME/bin/java and $JAVA_HOME/bin/jps is accessible. # GFV3_WORK: must be set to # CORBA_WS: must be set to the base of the current CORBA workspace # GFV3_WS: must be set to the base of the current GlasFish workspace ``` -------------------------------- ### GlassFishInstallation Class for Installation Tracking Source: https://github.com/eclipse-ee4j/orb/blob/master/iiop-folb-dev-test/README.html Explains the function of the GlassFishInstallation class, which keeps track of the basic GlassFish installation details. This is essential for managing different GlassFish versions and configurations. ```java // Keeps track of the basic GF installation ``` -------------------------------- ### Corbaloc Parsing Example Source: https://github.com/eclipse-ee4j/orb/blob/master/orbmain/src/main/java/com/sun/corba/ee/impl/orb/parsing_combinators.txt Illustrates parsing a corbaloc string using a combination of GIOP version, map sequence, and FSR splitter. It shows how to define `giopVersion` and `iiopAddress` using these parsing components. ```pseudocode What about corbaloc:? v12 = GIOPVersion.v12 ; giopVersion = construct( GIOPVersion.class ):mapSequence( [integer,integer] ):FSR(".") iiopAddress = mapSequence( [giopVersion,identity,integer] ): ``` -------------------------------- ### ORBD Initialization - Post-Init Steps Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/SAF/init_order.txt Indicates that no specific post-initialization steps are required in this context for ORBD. This simplifies the initialization flow by not requiring additional configuration after the main setup. ```Java // post_init: // - not needed here. ``` -------------------------------- ### IntParserFactory Example Source: https://github.com/eclipse-ee4j/orb/blob/master/orbmain/src/main/java/com/sun/corba/ee/impl/corba/orb_config_design.txt Demonstrates the creation of an integer range parser using the IntParserFactory. This factory provides a static method to generate parsers for specific integer ranges. ```java class IntParserFactory { static IntParser makeRangeIntParser( int min, int max ) ; } ``` -------------------------------- ### ORBDActivator Component Initialization Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/SAF/init_order.txt Describes the ORBDActivator component, its constructor, and methods for setting the request interceptor and the ORB. It highlights the need to get the root POA before starting operations and the dependency on the request interceptor. ```Java public class ORBDActivator { public ORBDActivator( ) public void setRequestInterceptor( RequestInterceptor requestInterceptor ) // holds this for init and getting slot id public void setORB( ORB orb ) // needs to get rootPOA before it starts operations // needs to call setORB on requestInterceptor } ``` -------------------------------- ### Complete Client Request After Interceptor Invocation (Java) Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/6763340_diffs.txt This Java method, `makeCompletedClientRequest`, is designed to be called when an error necessitates a retry after the initial client request setup but before the starting interceptor points have been fully processed. It handles the translation of reply statuses and invokes the client ending interceptor points, returning any resulting exception. It is part of the ORB's client-side interceptor mechanism. ```java // Needed when an error forces a retry AFTER initiateClientPIRequest // but BEFORE invokeClientPIStartingPoint. public Exception makeCompletedClientRequest( int replyStatus, Exception exception ) { if( !hasClientInterceptors ) return exception; if( !isClientPIEnabledForThisThread() ) return exception; // Translate ReplyMessage.replyStatus into PI replyStatus: // Note: this is also an assertion to make sure a valid replyStatus // is passed in (IndexOutOfBoundsException will be thrown otherwise) short piReplyStatus = REPLY_MESSAGE_TO_PI_REPLY_STATUS[replyStatus]; // Invoke the ending interception points and record exception // and reply status info in the info object: ClientRequestInfoImpl info = peekClientRequestInfoImplStack(); info.setReplyStatus( piReplyStatus ); info.setException( exception ); interceptorInvoker.invokeClientInterceptorEndingPoint( info ); piReplyStatus = info.getReplyStatus(); // Check reply status: if( (piReplyStatus == LOCATION_FORWARD.value) || (piReplyStatus == TRANSPORT_RETRY.value) ) { // This method is called when an exception occurs during // the initial processing of the client request, before // the request is sent. The exception is passed in. // The client ending interceptor points are invoked above. // If the interceptor points indicate a retry or forward, // the exception is returned. return exception; } return null; } ``` -------------------------------- ### Initialize ORB and Run Server in Java Source: https://github.com/eclipse-ee4j/orb/blob/master/src/share/classes/org/omg/PortableServer/package.html This Java code snippet shows the initialization of the CORBA ORB (Object Request Broker) and the subsequent execution of the server. It includes setting system properties, initializing the ORB, and running the server to listen for incoming requests. ```java Properties p = System.getProperties(); // p.put("org.omg.CORBA.ORBClass", "com.sun.corba.ee.internal.POA.POAORB"); ORB orb = ORB.init( args, p ); // ... (POA creation and object binding code) ... System.out.println("Hello Server: Ready..."); orb.run(); ``` -------------------------------- ### ORB Initialization Methods Source: https://github.com/eclipse-ee4j/orb/blob/master/omgapi/src/main/java/org/omg/CORBA/package.html These methods are used to initialize an application into the ORB and Object Adapter environments and obtain object references. ```APIDOC ## ORB Initialization Methods ### Description Initializes an application into the ORB and potentially the object adapter (POA) environments. These operations provide access to the ORB object reference for use in future ORB operations. ### Method `init()` ### Endpoint N/A (Method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java ORB orb = ORB.init(); ``` ### Response #### Success Response (200) Returns an `org.omg.CORBA.ORB` object reference. #### Response Example ```java // Java ORB object reference ``` --- ### Description Initializes an application into the ORB and potentially the object adapter (POA) environments, allowing for environment-specific data to be passed into the call. ### Method `init(String[] args, Properties props)` ### Endpoint N/A (Method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java Properties props = new Properties(); // ... set properties ... String[] args = {"-ORBInitialHost", "localhost"}; ORB orb = ORB.init(args, props); ``` ### Response #### Success Response (200) Returns an `org.omg.CORBA.ORB` object reference. #### Response Example ```java // Java ORB object reference ``` --- ### Description Initializes an application into the ORB and potentially the object adapter (POA) environments, specifically for applets. ### Method `init(Applet app, Properties props)` ### Endpoint N/A (Method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java // Assuming 'appletInstance' is an instance of java.applet.Applet Properties props = new Properties(); // ... set properties ... ORB orb = ORB.init(appletInstance, props); ``` ### Response #### Success Response (200) Returns an `org.omg.CORBA.ORB` object reference. #### Response Example ```java // Java ORB object reference ``` ``` -------------------------------- ### Set and Get Message ByteBuffer Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/testing_giop.html Demonstrates setting and getting the byte buffer associated with a message object. This is crucial for managing the raw data of a message. ```Java msg.setByteBuffer( buf ) ; byteBuffer = msg.getByteBuffer() ; msg.setByteBuffer( null ) ; ``` -------------------------------- ### Initialize GlassFish ORB in Java Source: https://context7.com/eclipse-ee4j/orb/llms.txt Demonstrates how to initialize the Object Request Broker (ORB) instance in Java using the `ORB.init()` factory method. It shows basic initialization with system properties and custom configurations, as well as obtaining a singleton ORB instance. The snippet also includes steps for shutting down and destroying the ORB. ```java import org.omg.CORBA.ORB; import java.util.Properties; public class ORBInitExample { public static void main(String[] args) { // Basic ORB initialization with command-line args and system properties ORB orb = ORB.init(args, System.getProperties()); // ORB initialization with custom properties Properties props = new Properties(); props.put("org.omg.CORBA.ORBInitialHost", "localhost"); props.put("org.omg.CORBA.ORBInitialPort", "1050"); props.put("com.sun.corba.ee.ORBServerPort", "1051"); props.put("com.sun.corba.ee.giop.ORBGIOPVersion", "1.2"); ORB customOrb = ORB.init(args, props); // Get singleton ORB (restricted, for TypeCode factory use) ORB singleton = ORB.init(); // Shutdown and cleanup orb.shutdown(true); // true = wait for completion orb.destroy(); } } ``` -------------------------------- ### AccountHolder Class Example (Java) Source: https://github.com/eclipse-ee4j/orb/blob/master/omgapi/src/main/java/org/omg/CORBA/package.html An example of a holder class generated for an 'Account' interface in Java. Holder classes are used to support out and inout parameter passing modes, as Java does not natively support them. They implement the Streamable interface for portable stubs and skeletons. ```java public final class AccountHolder implements org.omg.CORBA.portable.Streamable { // field that holds an Account object public Account value = null; // default constructor public AccountHolder () { } // creates a new AccountHolder from initialValue public AccountHolder (Account initialValue) { value = initialValue; } // reads the contents of i and assigns the contents to value public void _read (org.omg.CORBA.portable.InputStream i) { value = AccountHelper.read (i); } // writes value to o public void _write (org.omg.CORBA.portable.OutputStream o) { AccountHelper.write (o, value); } // returns the typecode for Account public org.omg.CORBA.TypeCode _type () { return AccountHelper.type (); } } ``` -------------------------------- ### Invoke Server PI Starting Point in Java Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/6763340_diffs.txt Invokes the starting point for server-side pseudo-interceptor (PI) processing. It retrieves server request information, invokes the interceptor, and handles potential exceptions or forward requests, with debug logging. ```java public void invokeServerPIStartingPoint() { if (orb.interceptorDebugFlag) { dputil.enter( "invokeServerPIStartingPoint" ) ; } try { if( !hasServerInterceptors ) return; ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); interceptorInvoker.invokeServerInterceptorStartingPoint( info ); // Handle SystemException or ForwardRequest: serverPIHandleExceptions( info ); } finally { if (orb.interceptorDebugFlag) { dputil.exit() ; } } } ``` -------------------------------- ### Registering with Monitoring Utility (Java) Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/monitoring.html This Java code snippet demonstrates how to register an object with the monitoring system using the MUtil class. It retrieves a MonitoredObject and adds attributes to it. Dependencies include the MUtil class and the orb object. ```java protected void registerWithMonitoring() { MonitoredObject thisMO = MUtil.get( orb, "/Connections/Inbound/" + getMonitoringName() ) ; thisMO.addAttribute( "NumberOfConnections", this ) ; thisMO.addAttribute( "NumberOfIdleConnections", this ) ; thisMO.addAttribute( "NumberOfBusyConnections", this ) ; } ``` -------------------------------- ### Invoke Client Interception Starting Point in Java Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/6763340_diffs.txt This Java code initiates the invocation of client-side interceptor starting points. It retrieves request information from a thread-local stack and calls the interceptor invoker. It also includes logic to check the reply status and potentially invoke ending points early if certain conditions are met. ```java if( !hasClientInterceptors ) return; if( !isClientPIEnabledForThisThread() ) return; // Invoke the starting interception points and record exception // and reply status info in the info object: ClientRequestInfoImpl info = peekClientRequestInfoImplStack(); interceptorInvoker.invokeClientInterceptorStartingPoint( info ); // Check reply status. If we will not have another chance later // to invoke the client ending points, do it now. short replyStatus = info.getReplyStatus(); if( (replyStatus == SYSTEM_EXCEPTION.value) || (replyStatus == LOCATION_FORWARD.value) ) { // Note: Transport retry cannot happen here since this happens ``` -------------------------------- ### Invoke Client Interceptor Starting Point (Java) Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/6763340_diffs.txt This Java code snippet details the process of invoking the starting point for client request interceptors. It manages the thread-local state, including pushing a slot table and setting the current execution point. Debugging logs are generated for entry and exit, along with provided arguments. ```java void invokeClientInterceptorStartingPoint( ClientRequestInfoImpl info ) { if (orb.interceptorDebugFlag) { dputil.enter( "invokeClientInterceptorStartingPoint", "info", info ) ; } try { // If invocation is not yet enabled, don't do anything. if( enabled ) { try { // Make a a fresh slot table available to TSC in case // interceptors need to make out calls. // Client's TSC is now RSC via RequestInfo. current.pushSlotTable( ); info.setPICurrentPushed( true ); info.setCurrentExecutionPoint( info.EXECUTION_POINT_STARTING ); // Get all ClientRequestInterceptors: ClientRequestInterceptor[] clientInterceptors = (ClientRequestInterceptor[])interceptorList. getInterceptors( InterceptorList.INTERCEPTOR_TYPE_CLIENT ); int size = clientInterceptors.length; // We will assume that all interceptors returned successfully, // and adjust the flowStackIndex to the appropriate value if // we later discover otherwise. int flowStackIndex = size; boolean continueProcessing = true; // Determine whether we are calling send_request or send_poll: // (This is currently commented out because our ORB does not ``` -------------------------------- ### Publish Glassfish CORBA ORB Site with Maven Source: https://github.com/eclipse-ee4j/orb/blob/master/README.md This snippet describes the steps to publish the project's website using Maven. It involves navigating to the checked-out target directory and executing Maven commands to verify the build, stage the site, and publish it via SCM. This process generates and deploys the project's documentation site. ```bash cd target/checkout mvn verify site site:stage scm-publish:publish-scm ``` -------------------------------- ### Initialize and Invoke IORInterceptors in Java Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/6763340_diffs.txt This Java code demonstrates the initialization and invocation of `IORInterceptor`s within the `InterceptorInvoker` class. It sets up the `IORInfoImpl` object and iterates through the registered `IORInterceptor`s to call their `establish_components` method. Debugging is enabled via `dputil.enter` and `dputil.exit` if `orb.interceptorDebugFlag` is true. ```Java import org.omg.CORBA.SystemException; import org.omg.PortableInterceptor.LOCATION_FORWARD; import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; import org.omg.PortableInterceptor.ClientRequestInterceptor; import org.omg.PortableInterceptor.ForwardRequest; import org.omg.PortableInterceptor.IORInterceptor; import org.omg.PortableInterceptor.IORInterceptor_3_0; import org.omg.PortableInterceptor.ServerRequestInterceptor; import org.omg.PortableInterceptor.ObjectReferenceTemplate; import com.sun.corba.ee.spi.ior.IOR; import com.sun.corba.ee.spi.oa.ObjectAdapter; import com.sun.corba.ee.spi.orb.ORB; import com.sun.corba.ee.impl.orbutil.DprintUtil; /** * Handles invocation of interceptors. Has specific knowledge of how to * invoke interceptors for various types of requests. */ public class InterceptorInvoker implements org.omg.PortableInterceptor.InterceptorManager { // The ORB private ORB orb; private DprintUtil dputil = new DprintUtil( this ) ; // The list of interceptors to be invoked private InterceptorList interceptorList; // The current PI_Current private org.omg.PortableInterceptor.Current piCurrent; /** * Constructor. * @param orb The ORB instance. */ public InterceptorInvoker( ORB orb ) { this.orb = orb; this.interceptorList = new InterceptorList( orb ); } /** * Set the current PI_Current. * @param piCurrent The PI_Current instance. */ public void setPICurrent( org.omg.PortableInterceptor.Current piCurrent ) { this.piCurrent = piCurrent; } private void dprint( String msg ) { ORBUtility.dprint( this, msg ) ; } /** * Enables or disables the interceptor invoker */ public void setEnabled( boolean enabled ) { this.enabled = enabled; } /** * Creates an IORInterceptor and invokes it. * @param oa The Object Adapter associated with the IOR interceptor. */ void objectAdapterCreated( ObjectAdapter oa ) { if (orb.interceptorDebugFlag) { dputil.enter( "objectAdapterCreated" ) ; } try { // If invocation is not yet enabled, don't do anything. if( enabled ) { // Create IORInfo object to pass to IORInterceptors: IORInfoImpl info = new IORInfoImpl( oa ); // Call each IORInterceptor: IORInterceptor[] iorInterceptors = (IORInterceptor[])interceptorList.getInterceptors( InterceptorList.INTERCEPTOR_TYPE_IOR ); int size = iorInterceptors.length; // Implementation note: // This loop counts backwards for greater efficiency. // Benchmarks have shown that counting down is more efficient // than counting up in Java for loops, as a compare to zero is // faster than a subtract and compare to zero. In this case, // it doesn't really matter much, but it's simply a force of habit. for( int i = (size - 1); i >= 0; i-- ) { IORInterceptor interceptor = iorInterceptors[i]; try { interceptor.establish_components( info ); } catch( Exception e ) { ``` -------------------------------- ### Invoke Server Interceptor Starting Point in Java Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/6763340_diffs.txt This Java code snippet demonstrates the invocation of server-side interceptors at the starting point of a request. It manages slot tables for the current context and thread-specific contexts, sets the execution point, and iterates through registered server request interceptors to call their `receive_request_service_contexts` method. It includes error handling for `ForwardRequest` exceptions and debug logging. ```Java void invokeServerInterceptorStartingPoint( ServerRequestInfoImpl info ) { if (orb.interceptorDebugFlag) { dputil.enter( "invokerServerInterceptorStartingPoint", "info", info ) ; } try { // If invocation is not yet enabled, don't do anything. if( enabled ) { try { // Make a fresh slot table for RSC. current.pushSlotTable(); info.setSlotTable(current.getSlotTable()); // Make a fresh slot table for TSC in case // interceptors need to make out calls. current.pushSlotTable( ); info.setCurrentExecutionPoint( info.EXECUTION_POINT_STARTING ); // Get all ServerRequestInterceptors: ServerRequestInterceptor[] serverInterceptors = (ServerRequestInterceptor[])interceptorList. getInterceptors( InterceptorList.INTERCEPTOR_TYPE_SERVER ); int size = serverInterceptors.length; // We will assume that all interceptors returned successfully, // and adjust the flowStackIndex to the appropriate value if // we later discover otherwise. int flowStackIndex = size; boolean continueProcessing = true; // Currently, there is only one server-side starting point // interceptor called receive_request_service_contexts. for( int i = 0; continueProcessing && (i < size); i++ ) { ServerRequestInterceptor sri = serverInterceptors[i] ; try { if (orb.interceptorDebugFlag) { dprint( ".invokeServerInterceptorStartingPoint: " + "Interceptor " + sri.name() + ".receive_request_service_contexts" ) ; } sri.receive_request_service_contexts( info ); } catch( ForwardRequest e ) { if (orb.interceptorDebugFlag) { dprint( ".invokeServerInterceptorStartingPoint " + "ForwardException from " + sri.name() ) ; } // If a ForwardRequest is thrown, we need to stop processing // further interceptors and set the flowStackIndex to the // current interceptor's index. continueProcessing = false; flowStackIndex = i; } catch( Exception e ) { // If any other exception is thrown, we need to record it // and continue processing, but we will not be able to // use the normal flowStackIndex. if (orb.interceptorDebugFlag) { dprint( ".invokeServerInterceptorStartingPoint " + "Exception from " + sri.name() ) ; } info.setEndingPointCall( endingPointCall ); info.setReplyStatus( SYSTEM_EXCEPTION.value ); info.setException( e ); continueProcessing = false; flowStackIndex = i; } } // If we are continuing processing, then we need to set the // flowStackIndex to the appropriate value. if (continueProcessing) { info.setFlowStackIndex(flowStackIndex); } } finally { // See doc for setPICurrentPushed as to why this is necessary. // Check info for null in case errors happen before initiate. if (info != null && info.isPICurrentPushed()) { current.popSlotTable( ); // After the pop, original client's TSC slot table // remains avaiable via PICurrent. } } } // end enabled check } finally { if (orb.interceptorDebugFlag) { dputil.exit() ; } } } ``` -------------------------------- ### StubAdapter SPI Methods for Dynamic Proxy Stubs Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/dynamic_rmi_iiop.htm The StubAdapter SPI provides static methods to interact with dynamic proxy stubs. These methods handle common operations like checking if an object is a stub, setting and getting delegates, activating servants and ties, retrieving the ORB instance, getting type IDs, connecting stubs, and checking if a stub is local. The implementation logic differentiates between java.rmi.CORBA.Stub and DynamicStub types. ```java boolean isStubClass( Class ); boolean isStub( Object ); void setDelegate( Object, Delegate ); Delegate getDelegate( Object ); org.omg.CORBA.Object activateServant( Servant ); org.omg.CORBA.Object activateTie( Tie ); ORB getORB( Object ); String[] getTypeIds( Object ); void connect( Object, ORB ); boolean isLocal( Object ); OutputStream request( Object, String, boolean ); ``` -------------------------------- ### ExternalExec: Separate Process Execution Source: https://github.com/eclipse-ee4j/orb/blob/master/functional-tests/src/test/java/corba/framework/package.html ExternalExec runs a class in a separate process. The start() method returns immediately after initiating the process. This is the default strategy for client tests. ```java ExternalExec ``` -------------------------------- ### Create Server Instance Templates in ORBD Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/orbdArchitecture.html This snippet details the steps to explicitly create a server instance template using ORBD. It involves initializing an ORB instance, registering acceptors for transports, creating POAs with specific policies, extracting IOR templates, and storing them. This process avoids duplicate code maintenance by using the same code for template construction and POA initialization. ```Java ORB orb = ORB.init(); // ... set server ID, configure IOR interceptor ... // Register acceptors for transports ((com.sun.corba.ee.spi.orb.ORB)orb).registerAcceptor(...); // For each deployed EJB: // 1. Create POA with correct name and policies POA poa = ...; // 2. Extract IOR template IORTemplate iortemp = ((ObjectAdapterBase)poa).getIORTemplate(); // 3. Store the template ``` -------------------------------- ### Prepare and Perform Release with Maven Source: https://github.com/eclipse-ee4j/orb/blob/master/README.md This snippet details the Maven commands used to prepare and perform a release for the Glassfish CORBA ORB project. It requires `gpg-agent` to be running for signing artifacts. The commands automate version management, artifact building, and deployment to repositories. ```bash mvn -B release:prepare release:perform ``` -------------------------------- ### ORBD Initialization - Pre-Init Steps Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/SAF/init_order.txt Outlines the steps performed during the pre-initialization phase of ORBD. This includes allocating a slot ID, creating the activator and request interceptor, setting the request interceptor on the activator, adding the client request, and binding the activator in the initial naming service. ```Java // pre_init: // - allocate slot id // - create activator ( ) // - create request interceptor( activator, slot id ) // - activator.setRequestInterceptor( interceptor ) // - add_client_request( request interceptor ) // - bind activator in initial naming ``` -------------------------------- ### Get Root Monitored Object using ORB Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/monitoring.html Retrieves the root monitored object directly from the ORB instance. This is an alternative method to using MonitoringFactories and is noted to have discrepancies with the former under certain configurations. ```java orb.getMonitoringManager().getRootMonitoredObject() ``` -------------------------------- ### Get Number of Work Items Currently in WorkQueue (Java) Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/ThreadPool.html Returns the number of work items that are currently waiting in the WorkQueue to be processed. ```Java public int workItemsInQueue(); ``` -------------------------------- ### Configure GlassFish ORB with System Properties (Java) Source: https://context7.com/eclipse-ee4j/orb/llms.txt This Java code demonstrates how to initialize the ORB with a comprehensive set of system properties. These properties control various aspects of the ORB, including its ID, network settings, GIOP protocol details, transport configurations, code set handling, performance options, and debugging levels. The ORB is initialized using these properties, and then shut down. ```java import org.omg.CORBA.ORB; import com.sun.corba.ee.spi.misc.ORBConstants; import java.util.Properties; public class ORBConfigExample { public static void main(String[] args) { Properties props = new Properties(); // Basic ORB configuration props.put(ORBConstants.ORB_ID_PROPERTY, "MyORB"); props.put(ORBConstants.INITIAL_HOST_PROPERTY, "localhost"); props.put(ORBConstants.INITIAL_PORT_PROPERTY, "1050"); // Server configuration props.put(ORBConstants.SERVER_HOST_PROPERTY, "0.0.0.0"); props.put(ORBConstants.SERVER_PORT_PROPERTY, "1051"); props.put(ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY, "1052"); // GIOP configuration props.put(ORBConstants.GIOP_VERSION, "1.2"); props.put(ORBConstants.GIOP_FRAGMENT_SIZE, "4096"); props.put(ORBConstants.GIOP_BUFFER_SIZE, "4096"); // Transport configuration props.put(ORBConstants.HIGH_WATER_MARK_PROPERTY, "240"); props.put(ORBConstants.LOW_WATER_MARK_PROPERTY, "100"); props.put(ORBConstants.USE_NIO_SELECT_TO_WAIT_PROPERTY, "true"); props.put(ORBConstants.ACCEPTOR_SOCKET_TYPE_PROPERTY, "SocketChannel"); // Connection timeouts (format: initial:max:backoff:maxSingle) props.put(ORBConstants.TRANSPORT_TCP_TIMEOUTS_PROPERTY, "2000:6000:20:5000"); props.put(ORBConstants.TRANSPORT_TCP_CONNECT_TIMEOUTS_PROPERTY, "250:60000:100:5000"); // Code set configuration props.put(ORBConstants.CHAR_CODESETS, "0x00010001,0x05010001"); props.put(ORBConstants.WCHAR_CODESETS, "0x00010109,0x05010001"); // Performance options props.put(ORBConstants.ALLOW_LOCAL_OPTIMIZATION, "true"); props.put(ORBConstants.USE_DYNAMIC_STUB_PROPERTY, "true"); // Debugging (comma-separated: transport,subcontract,poa,giop,naming) props.put(ORBConstants.DEBUG_PROPERTY, "transport,poa"); // Initialize ORB with configuration ORB orb = ORB.init(args, props); System.out.println("ORB initialized with custom configuration"); orb.shutdown(true); } } ``` -------------------------------- ### Get Thread Pool Name (Java) Source: https://github.com/eclipse-ee4j/orb/blob/master/www/design/ThreadPool.html Retrieves the name of the thread pool. This is useful for identifying specific thread pools in a system. ```Java public String getName(); ```