Java Code Examples for org.omg.CORBA.NVList#item()
The following examples show how to use
org.omg.CORBA.NVList#item() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RequestInfoImpl.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Internal utility method to convert an NVList into a PI Parameter[] */ protected Parameter[] nvListToParameterArray( NVList parNVList ) { // _REVISIT_ This utility method should probably be doing a deep // copy so interceptor can't accidentally change the arguments. int count = parNVList.count(); Parameter[] plist = new Parameter[count]; try { for( int i = 0; i < count; i++ ) { Parameter p = new Parameter(); plist[i] = p; NamedValue nv = parNVList.item( i ); plist[i].argument = nv.value(); // ParameterMode spec can be found in 99-10-07.pdf // Section:10.5.22 // nv.flags spec can be found in 99-10-07.pdf // Section 7.1.1 // nv.flags has ARG_IN as 1, ARG_OUT as 2 and ARG_INOUT as 3 // To convert this into enum PARAM_IN, PARAM_OUT and // PARAM_INOUT the value is subtracted by 1. plist[i].mode = ParameterMode.from_int( nv.flags() - 1 ); } } catch ( Exception e ) { throw wrapper.exceptionInArguments( e ) ; } return plist; }
Example 2
Source File: RequestInfoImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Internal utility method to convert an NVList into a PI Parameter[] */ protected Parameter[] nvListToParameterArray( NVList parNVList ) { // _REVISIT_ This utility method should probably be doing a deep // copy so interceptor can't accidentally change the arguments. int count = parNVList.count(); Parameter[] plist = new Parameter[count]; try { for( int i = 0; i < count; i++ ) { Parameter p = new Parameter(); plist[i] = p; NamedValue nv = parNVList.item( i ); plist[i].argument = nv.value(); // ParameterMode spec can be found in 99-10-07.pdf // Section:10.5.22 // nv.flags spec can be found in 99-10-07.pdf // Section 7.1.1 // nv.flags has ARG_IN as 1, ARG_OUT as 2 and ARG_INOUT as 3 // To convert this into enum PARAM_IN, PARAM_OUT and // PARAM_INOUT the value is subtracted by 1. plist[i].mode = ParameterMode.from_int( nv.flags() - 1 ); } } catch ( Exception e ) { throw wrapper.exceptionInArguments( e ) ; } return plist; }
Example 3
Source File: ServerRequestImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void arguments(NVList args) { if (_paramsCalled) throw _wrapper.argumentsCalledMultiple() ; if (_exceptionSet) throw _wrapper.argumentsCalledAfterException() ; if (args == null ) throw _wrapper.argumentsCalledNullArgs() ; _paramsCalled = true; NamedValue arg = null; for (int i=0; i < args.count() ; i++) { try { arg = args.item(i); } catch (Bounds e) { throw _wrapper.boundsCannotOccur(e) ; } try { if ((arg.flags() == org.omg.CORBA.ARG_IN.value) || (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { // unmarshal the value into the Any arg.value().read_value(_ins, arg.value().type()); } } catch ( Exception ex ) { throw _wrapper.badArgumentsNvlist( ex ) ; } } // hang on to the NVList for marshaling the result _arguments = args; _orb.getPIHandler().setServerPIInfo( _arguments ); _orb.getPIHandler().invokeServerPIIntermediatePoint(); }
Example 4
Source File: RequestInfoImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Internal utility method to convert an NVList into a PI Parameter[] */ protected Parameter[] nvListToParameterArray( NVList parNVList ) { // _REVISIT_ This utility method should probably be doing a deep // copy so interceptor can't accidentally change the arguments. int count = parNVList.count(); Parameter[] plist = new Parameter[count]; try { for( int i = 0; i < count; i++ ) { Parameter p = new Parameter(); plist[i] = p; NamedValue nv = parNVList.item( i ); plist[i].argument = nv.value(); // ParameterMode spec can be found in 99-10-07.pdf // Section:10.5.22 // nv.flags spec can be found in 99-10-07.pdf // Section 7.1.1 // nv.flags has ARG_IN as 1, ARG_OUT as 2 and ARG_INOUT as 3 // To convert this into enum PARAM_IN, PARAM_OUT and // PARAM_INOUT the value is subtracted by 1. plist[i].mode = ParameterMode.from_int( nv.flags() - 1 ); } } catch ( Exception e ) { throw wrapper.exceptionInArguments( e ) ; } return plist; }
Example 5
Source File: ServerRequestImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void arguments(NVList args) { if (_paramsCalled) throw _wrapper.argumentsCalledMultiple() ; if (_exceptionSet) throw _wrapper.argumentsCalledAfterException() ; if (args == null ) throw _wrapper.argumentsCalledNullArgs() ; _paramsCalled = true; NamedValue arg = null; for (int i=0; i < args.count() ; i++) { try { arg = args.item(i); } catch (Bounds e) { throw _wrapper.boundsCannotOccur(e) ; } try { if ((arg.flags() == org.omg.CORBA.ARG_IN.value) || (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { // unmarshal the value into the Any arg.value().read_value(_ins, arg.value().type()); } } catch ( Exception ex ) { throw _wrapper.badArgumentsNvlist( ex ) ; } } // hang on to the NVList for marshaling the result _arguments = args; _orb.getPIHandler().setServerPIInfo( _arguments ); _orb.getPIHandler().invokeServerPIIntermediatePoint(); }
Example 6
Source File: RequestInfoImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Internal utility method to convert an NVList into a PI Parameter[] */ protected Parameter[] nvListToParameterArray( NVList parNVList ) { // _REVISIT_ This utility method should probably be doing a deep // copy so interceptor can't accidentally change the arguments. int count = parNVList.count(); Parameter[] plist = new Parameter[count]; try { for( int i = 0; i < count; i++ ) { Parameter p = new Parameter(); plist[i] = p; NamedValue nv = parNVList.item( i ); plist[i].argument = nv.value(); // ParameterMode spec can be found in 99-10-07.pdf // Section:10.5.22 // nv.flags spec can be found in 99-10-07.pdf // Section 7.1.1 // nv.flags has ARG_IN as 1, ARG_OUT as 2 and ARG_INOUT as 3 // To convert this into enum PARAM_IN, PARAM_OUT and // PARAM_INOUT the value is subtracted by 1. plist[i].mode = ParameterMode.from_int( nv.flags() - 1 ); } } catch ( Exception e ) { throw wrapper.exceptionInArguments( e ) ; } return plist; }
Example 7
Source File: ServerRequestImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void arguments(NVList args) { if (_paramsCalled) throw _wrapper.argumentsCalledMultiple() ; if (_exceptionSet) throw _wrapper.argumentsCalledAfterException() ; if (args == null ) throw _wrapper.argumentsCalledNullArgs() ; _paramsCalled = true; NamedValue arg = null; for (int i=0; i < args.count() ; i++) { try { arg = args.item(i); } catch (Bounds e) { throw _wrapper.boundsCannotOccur(e) ; } try { if ((arg.flags() == org.omg.CORBA.ARG_IN.value) || (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { // unmarshal the value into the Any arg.value().read_value(_ins, arg.value().type()); } } catch ( Exception ex ) { throw _wrapper.badArgumentsNvlist( ex ) ; } } // hang on to the NVList for marshaling the result _arguments = args; _orb.getPIHandler().setServerPIInfo( _arguments ); _orb.getPIHandler().invokeServerPIIntermediatePoint(); }
Example 8
Source File: ServerRequestImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
public void arguments(NVList args) { if (_paramsCalled) throw _wrapper.argumentsCalledMultiple() ; if (_exceptionSet) throw _wrapper.argumentsCalledAfterException() ; if (args == null ) throw _wrapper.argumentsCalledNullArgs() ; _paramsCalled = true; NamedValue arg = null; for (int i=0; i < args.count() ; i++) { try { arg = args.item(i); } catch (Bounds e) { throw _wrapper.boundsCannotOccur(e) ; } try { if ((arg.flags() == org.omg.CORBA.ARG_IN.value) || (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { // unmarshal the value into the Any arg.value().read_value(_ins, arg.value().type()); } } catch ( Exception ex ) { throw _wrapper.badArgumentsNvlist( ex ) ; } } // hang on to the NVList for marshaling the result _arguments = args; _orb.getPIHandler().setServerPIInfo( _arguments ); _orb.getPIHandler().invokeServerPIIntermediatePoint(); }
Example 9
Source File: ServerRequestImpl.java From JDKSourceCode1.8 with MIT License | 5 votes |
public void arguments(NVList args) { if (_paramsCalled) throw _wrapper.argumentsCalledMultiple() ; if (_exceptionSet) throw _wrapper.argumentsCalledAfterException() ; if (args == null ) throw _wrapper.argumentsCalledNullArgs() ; _paramsCalled = true; NamedValue arg = null; for (int i=0; i < args.count() ; i++) { try { arg = args.item(i); } catch (Bounds e) { throw _wrapper.boundsCannotOccur(e) ; } try { if ((arg.flags() == org.omg.CORBA.ARG_IN.value) || (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { // unmarshal the value into the Any arg.value().read_value(_ins, arg.value().type()); } } catch ( Exception ex ) { throw _wrapper.badArgumentsNvlist( ex ) ; } } // hang on to the NVList for marshaling the result _arguments = args; _orb.getPIHandler().setServerPIInfo( _arguments ); _orb.getPIHandler().invokeServerPIIntermediatePoint(); }
Example 10
Source File: RequestInfoImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Internal utility method to convert an NVList into a PI Parameter[] */ protected Parameter[] nvListToParameterArray( NVList parNVList ) { // _REVISIT_ This utility method should probably be doing a deep // copy so interceptor can't accidentally change the arguments. int count = parNVList.count(); Parameter[] plist = new Parameter[count]; try { for( int i = 0; i < count; i++ ) { Parameter p = new Parameter(); plist[i] = p; NamedValue nv = parNVList.item( i ); plist[i].argument = nv.value(); // ParameterMode spec can be found in 99-10-07.pdf // Section:10.5.22 // nv.flags spec can be found in 99-10-07.pdf // Section 7.1.1 // nv.flags has ARG_IN as 1, ARG_OUT as 2 and ARG_INOUT as 3 // To convert this into enum PARAM_IN, PARAM_OUT and // PARAM_INOUT the value is subtracted by 1. plist[i].mode = ParameterMode.from_int( nv.flags() - 1 ); } } catch ( Exception e ) { throw wrapper.exceptionInArguments( e ) ; } return plist; }
Example 11
Source File: ServerRequestImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void arguments(NVList args) { if (_paramsCalled) throw _wrapper.argumentsCalledMultiple() ; if (_exceptionSet) throw _wrapper.argumentsCalledAfterException() ; if (args == null ) throw _wrapper.argumentsCalledNullArgs() ; _paramsCalled = true; NamedValue arg = null; for (int i=0; i < args.count() ; i++) { try { arg = args.item(i); } catch (Bounds e) { throw _wrapper.boundsCannotOccur(e) ; } try { if ((arg.flags() == org.omg.CORBA.ARG_IN.value) || (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { // unmarshal the value into the Any arg.value().read_value(_ins, arg.value().type()); } } catch ( Exception ex ) { throw _wrapper.badArgumentsNvlist( ex ) ; } } // hang on to the NVList for marshaling the result _arguments = args; _orb.getPIHandler().setServerPIInfo( _arguments ); _orb.getPIHandler().invokeServerPIIntermediatePoint(); }
Example 12
Source File: ServerRequestImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void arguments(NVList args) { if (_paramsCalled) throw _wrapper.argumentsCalledMultiple() ; if (_exceptionSet) throw _wrapper.argumentsCalledAfterException() ; if (args == null ) throw _wrapper.argumentsCalledNullArgs() ; _paramsCalled = true; NamedValue arg = null; for (int i=0; i < args.count() ; i++) { try { arg = args.item(i); } catch (Bounds e) { throw _wrapper.boundsCannotOccur(e) ; } try { if ((arg.flags() == org.omg.CORBA.ARG_IN.value) || (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { // unmarshal the value into the Any arg.value().read_value(_ins, arg.value().type()); } } catch ( Exception ex ) { throw _wrapper.badArgumentsNvlist( ex ) ; } } // hang on to the NVList for marshaling the result _arguments = args; _orb.getPIHandler().setServerPIInfo( _arguments ); _orb.getPIHandler().invokeServerPIIntermediatePoint(); }
Example 13
Source File: RequestInfoImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Internal utility method to convert an NVList into a PI Parameter[] */ protected Parameter[] nvListToParameterArray( NVList parNVList ) { // _REVISIT_ This utility method should probably be doing a deep // copy so interceptor can't accidentally change the arguments. int count = parNVList.count(); Parameter[] plist = new Parameter[count]; try { for( int i = 0; i < count; i++ ) { Parameter p = new Parameter(); plist[i] = p; NamedValue nv = parNVList.item( i ); plist[i].argument = nv.value(); // ParameterMode spec can be found in 99-10-07.pdf // Section:10.5.22 // nv.flags spec can be found in 99-10-07.pdf // Section 7.1.1 // nv.flags has ARG_IN as 1, ARG_OUT as 2 and ARG_INOUT as 3 // To convert this into enum PARAM_IN, PARAM_OUT and // PARAM_INOUT the value is subtracted by 1. plist[i].mode = ParameterMode.from_int( nv.flags() - 1 ); } } catch ( Exception e ) { throw wrapper.exceptionInArguments( e ) ; } return plist; }
Example 14
Source File: ClientRequestInfoImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * See RequestInfoImpl for javadoc. */ public String[] operation_context (){ checkAccess( MID_OPERATION_CONTEXT ); if( cachedOperationContext == null ) { if( request == null ) { throw stdWrapper.piOperationNotSupported4() ; } // Get the list of contexts from DII request data, If there are // no contexts then this method will return null. Context ctx = request.ctx( ); // _REVISIT_ The API for get_values is not compliant with the spec, // Revisit this code once it's fixed. // _REVISIT_ Our ORB doesn't support Operation Context, This code // will not be excerscised until it's supported. // The first parameter in get_values is the start_scope which // if blank makes it as a global scope. // The second parameter is op_flags which is set to RESTRICT_SCOPE // As there is only one defined in the spec. // The Third param is the pattern which is '*' requiring it to // get all the contexts. NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" ); String[] context = new String[(nvList.count() * 2) ]; if( ( nvList != null ) &&( nvList.count() != 0 ) ) { // The String[] array will contain Name and Value for each // context and hence double the size in the array. int index = 0; for( int i = 0; i < nvList.count(); i++ ) { NamedValue nv; try { nv = nvList.item( i ); } catch (Exception e ) { return (String[]) null; } context[index] = nv.name(); index++; context[index] = nv.value().extract_string(); index++; } } cachedOperationContext = context; } // Good citizen: In the interest of efficiency, we assume // interceptors will be "good citizens" in that they will not // modify the contents of the String[] array. return cachedOperationContext; }
Example 15
Source File: ClientRequestInfoImpl.java From JDKSourceCode1.8 with MIT License | 4 votes |
/** * See RequestInfoImpl for javadoc. */ public String[] operation_context (){ checkAccess( MID_OPERATION_CONTEXT ); if( cachedOperationContext == null ) { if( request == null ) { throw stdWrapper.piOperationNotSupported4() ; } // Get the list of contexts from DII request data, If there are // no contexts then this method will return null. Context ctx = request.ctx( ); // _REVISIT_ The API for get_values is not compliant with the spec, // Revisit this code once it's fixed. // _REVISIT_ Our ORB doesn't support Operation Context, This code // will not be excerscised until it's supported. // The first parameter in get_values is the start_scope which // if blank makes it as a global scope. // The second parameter is op_flags which is set to RESTRICT_SCOPE // As there is only one defined in the spec. // The Third param is the pattern which is '*' requiring it to // get all the contexts. NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" ); String[] context = new String[(nvList.count() * 2) ]; if( ( nvList != null ) &&( nvList.count() != 0 ) ) { // The String[] array will contain Name and Value for each // context and hence double the size in the array. int index = 0; for( int i = 0; i < nvList.count(); i++ ) { NamedValue nv; try { nv = nvList.item( i ); } catch (Exception e ) { return (String[]) null; } context[index] = nv.name(); index++; context[index] = nv.value().extract_string(); index++; } } cachedOperationContext = context; } // Good citizen: In the interest of efficiency, we assume // interceptors will be "good citizens" in that they will not // modify the contents of the String[] array. return cachedOperationContext; }
Example 16
Source File: ClientRequestInfoImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * See RequestInfoImpl for javadoc. */ public String[] operation_context (){ checkAccess( MID_OPERATION_CONTEXT ); if( cachedOperationContext == null ) { if( request == null ) { throw stdWrapper.piOperationNotSupported4() ; } // Get the list of contexts from DII request data, If there are // no contexts then this method will return null. Context ctx = request.ctx( ); // _REVISIT_ The API for get_values is not compliant with the spec, // Revisit this code once it's fixed. // _REVISIT_ Our ORB doesn't support Operation Context, This code // will not be excerscised until it's supported. // The first parameter in get_values is the start_scope which // if blank makes it as a global scope. // The second parameter is op_flags which is set to RESTRICT_SCOPE // As there is only one defined in the spec. // The Third param is the pattern which is '*' requiring it to // get all the contexts. NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" ); String[] context = new String[(nvList.count() * 2) ]; if( ( nvList != null ) &&( nvList.count() != 0 ) ) { // The String[] array will contain Name and Value for each // context and hence double the size in the array. int index = 0; for( int i = 0; i < nvList.count(); i++ ) { NamedValue nv; try { nv = nvList.item( i ); } catch (Exception e ) { return (String[]) null; } context[index] = nv.name(); index++; context[index] = nv.value().extract_string(); index++; } } cachedOperationContext = context; } // Good citizen: In the interest of efficiency, we assume // interceptors will be "good citizens" in that they will not // modify the contents of the String[] array. return cachedOperationContext; }
Example 17
Source File: ClientRequestInfoImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * See RequestInfoImpl for javadoc. */ public String[] operation_context (){ checkAccess( MID_OPERATION_CONTEXT ); if( cachedOperationContext == null ) { if( request == null ) { throw stdWrapper.piOperationNotSupported4() ; } // Get the list of contexts from DII request data, If there are // no contexts then this method will return null. Context ctx = request.ctx( ); // _REVISIT_ The API for get_values is not compliant with the spec, // Revisit this code once it's fixed. // _REVISIT_ Our ORB doesn't support Operation Context, This code // will not be excerscised until it's supported. // The first parameter in get_values is the start_scope which // if blank makes it as a global scope. // The second parameter is op_flags which is set to RESTRICT_SCOPE // As there is only one defined in the spec. // The Third param is the pattern which is '*' requiring it to // get all the contexts. NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" ); String[] context = new String[(nvList.count() * 2) ]; if( ( nvList != null ) &&( nvList.count() != 0 ) ) { // The String[] array will contain Name and Value for each // context and hence double the size in the array. int index = 0; for( int i = 0; i < nvList.count(); i++ ) { NamedValue nv; try { nv = nvList.item( i ); } catch (Exception e ) { return (String[]) null; } context[index] = nv.name(); index++; context[index] = nv.value().extract_string(); index++; } } cachedOperationContext = context; } // Good citizen: In the interest of efficiency, we assume // interceptors will be "good citizens" in that they will not // modify the contents of the String[] array. return cachedOperationContext; }
Example 18
Source File: ClientRequestInfoImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * See RequestInfoImpl for javadoc. */ public String[] operation_context (){ checkAccess( MID_OPERATION_CONTEXT ); if( cachedOperationContext == null ) { if( request == null ) { throw stdWrapper.piOperationNotSupported4() ; } // Get the list of contexts from DII request data, If there are // no contexts then this method will return null. Context ctx = request.ctx( ); // _REVISIT_ The API for get_values is not compliant with the spec, // Revisit this code once it's fixed. // _REVISIT_ Our ORB doesn't support Operation Context, This code // will not be excerscised until it's supported. // The first parameter in get_values is the start_scope which // if blank makes it as a global scope. // The second parameter is op_flags which is set to RESTRICT_SCOPE // As there is only one defined in the spec. // The Third param is the pattern which is '*' requiring it to // get all the contexts. NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" ); String[] context = new String[(nvList.count() * 2) ]; if( ( nvList != null ) &&( nvList.count() != 0 ) ) { // The String[] array will contain Name and Value for each // context and hence double the size in the array. int index = 0; for( int i = 0; i < nvList.count(); i++ ) { NamedValue nv; try { nv = nvList.item( i ); } catch (Exception e ) { return (String[]) null; } context[index] = nv.name(); index++; context[index] = nv.value().extract_string(); index++; } } cachedOperationContext = context; } // Good citizen: In the interest of efficiency, we assume // interceptors will be "good citizens" in that they will not // modify the contents of the String[] array. return cachedOperationContext; }
Example 19
Source File: ClientRequestInfoImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * See RequestInfoImpl for javadoc. */ public String[] operation_context (){ checkAccess( MID_OPERATION_CONTEXT ); if( cachedOperationContext == null ) { if( request == null ) { throw stdWrapper.piOperationNotSupported4() ; } // Get the list of contexts from DII request data, If there are // no contexts then this method will return null. Context ctx = request.ctx( ); // _REVISIT_ The API for get_values is not compliant with the spec, // Revisit this code once it's fixed. // _REVISIT_ Our ORB doesn't support Operation Context, This code // will not be excerscised until it's supported. // The first parameter in get_values is the start_scope which // if blank makes it as a global scope. // The second parameter is op_flags which is set to RESTRICT_SCOPE // As there is only one defined in the spec. // The Third param is the pattern which is '*' requiring it to // get all the contexts. NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" ); String[] context = new String[(nvList.count() * 2) ]; if( ( nvList != null ) &&( nvList.count() != 0 ) ) { // The String[] array will contain Name and Value for each // context and hence double the size in the array. int index = 0; for( int i = 0; i < nvList.count(); i++ ) { NamedValue nv; try { nv = nvList.item( i ); } catch (Exception e ) { return (String[]) null; } context[index] = nv.name(); index++; context[index] = nv.value().extract_string(); index++; } } cachedOperationContext = context; } // Good citizen: In the interest of efficiency, we assume // interceptors will be "good citizens" in that they will not // modify the contents of the String[] array. return cachedOperationContext; }
Example 20
Source File: ClientRequestInfoImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
/** * See RequestInfoImpl for javadoc. */ public String[] operation_context (){ checkAccess( MID_OPERATION_CONTEXT ); if( cachedOperationContext == null ) { if( request == null ) { throw stdWrapper.piOperationNotSupported4() ; } // Get the list of contexts from DII request data, If there are // no contexts then this method will return null. Context ctx = request.ctx( ); // _REVISIT_ The API for get_values is not compliant with the spec, // Revisit this code once it's fixed. // _REVISIT_ Our ORB doesn't support Operation Context, This code // will not be excerscised until it's supported. // The first parameter in get_values is the start_scope which // if blank makes it as a global scope. // The second parameter is op_flags which is set to RESTRICT_SCOPE // As there is only one defined in the spec. // The Third param is the pattern which is '*' requiring it to // get all the contexts. NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" ); String[] context = new String[(nvList.count() * 2) ]; if( ( nvList != null ) &&( nvList.count() != 0 ) ) { // The String[] array will contain Name and Value for each // context and hence double the size in the array. int index = 0; for( int i = 0; i < nvList.count(); i++ ) { NamedValue nv; try { nv = nvList.item( i ); } catch (Exception e ) { return (String[]) null; } context[index] = nv.name(); index++; context[index] = nv.value().extract_string(); index++; } } cachedOperationContext = context; } // Good citizen: In the interest of efficiency, we assume // interceptors will be "good citizens" in that they will not // modify the contents of the String[] array. return cachedOperationContext; }