Package org.omg.CORBA

Examples of org.omg.CORBA.MARSHAL


            } catch (AccessException e) {
                log.debug("AccessException", e);
                throw (SystemException)new NO_PERMISSION(e.toString()).initCause(e);
            } catch (MarshalException e) {
                log.debug("MarshalException", e);
                throw (SystemException)new MARSHAL(e.toString()).initCause(e);
            } catch (RemoteException e) {
                log.debug("RemoteException", e);
                throw (SystemException)new UnknownException(e).initCause(e);
            } catch (RuntimeException e) {
                log.debug("RuntimeException", e);
View Full Code Here


                InterfaceType servantType = servant.getInterfaceType();
                String deploymentId = servant.getEjbDeployment().getDeploymentId();
                try {
                    RefGenerator refGenerator = AdapterWrapper.getRefGenerator(deploymentId);
                    if (refGenerator == null) {
                        throw new MARSHAL("Could not find RefGenerator for deployment id: " + deploymentId);
                    }
                    if (InterfaceType.EJB_HOME == servantType) {
                        obj = refGenerator.genHomeReference();
                    } else if (InterfaceType.EJB_OBJECT == servantType) {
                        obj = refGenerator.genObjectReference(servant.getPrimaryKey());
                    } else {
                        log.error("Encountered unknown local invocation handler of type " + servantType + ":" + deploymentId);
                        throw new MARSHAL("Internal server error while marshaling the reply", 0, CompletionStatus.COMPLETED_YES);
                    }
                } catch (CORBAException e) {
                    log.error("Encountered unknown local invocation handler of type " + servantType + ":" + deploymentId);
                    throw (MARSHAL)new MARSHAL("Internal server error while marshaling the reply", 0, CompletionStatus.COMPLETED_YES).initCause(e);
                }
            }
            delegate.writeRemoteObject(out, obj);
        } catch (Throwable e) {
            log.error("Received unexpected exception while marshaling an object reference:", e);
            throw (MARSHAL)new MARSHAL("Internal server error while marshaling the reply", 0, CompletionStatus.COMPLETED_YES).initCause(e);
        }
    }
View Full Code Here

        BeanContext beanContext = ejbProxyHandler.getBeanContext();
        String deploymentId = (String) beanContext.getDeploymentID();
        try {
            RefGenerator refGenerator = AdapterWrapper.getRefGenerator(deploymentId);
            if (refGenerator == null) {
                throw new MARSHAL("Could not find RefGenerator for deployment id: " +deploymentId);
            }
            if (proxy instanceof EJBHome) {
                return refGenerator.genHomeReference();
            } else if (proxy instanceof EJBObject) {
                Object primaryKey = null;
                if (beanContext.getComponentType() == BeanType.STATEFUL) {
                    RegistryId id = (RegistryId)((EjbObjectProxyHandler)ejbProxyHandler).getRegistryId();
                    primaryKey = id.getPrimaryKey();
                }
                else if (beanContext.getComponentType() != BeanType.STATELESS) {
                    EJBObject ejbObject = (EJBObject) proxy;
                    primaryKey = ejbObject.getPrimaryKey();
                }
                return refGenerator.genObjectReference(primaryKey);
            } else {
                log.error("Encountered unknown local invocation handler of type " + proxy.getClass().getSuperclass() + ":" + deploymentId);
                throw new MARSHAL("Internal server error while marshaling the reply", 0, CompletionStatus.COMPLETED_YES);
            }
        } catch (CORBAException e) {
            log.error("Encountered unknown local invocation handler of type " + proxy.getClass().getSuperclass() + ":" + deploymentId);
            throw (MARSHAL)new MARSHAL("Encountered unknown local invocation handler of type " + proxy.getClass().getSuperclass() + ":" + deploymentId, 0, CompletionStatus.COMPLETED_YES).initCause(e);
        } catch (RemoteException e) {
            log.error("Unable to get primary key from bean from bean of type " + proxy.getClass().getSuperclass() + ":" + deploymentId);
            throw (MARSHAL)new MARSHAL("Unable to get primary key from bean from bean of type " + proxy.getClass().getSuperclass() + ":" + deploymentId, 0, CompletionStatus.COMPLETED_YES).initCause(e);
        }
    }
View Full Code Here

                            write_octet ((byte)0x03);
                            break;
                        }
                        default:
                        {
                            throw new MARSHAL ("Invalid SYNC_SCOPE: " + syncScope);
                        }
                    }
                }

                write_octet_array( reserved,0,3 );
                TargetAddressHelper.write( this, addr );
                write_string( operation );
                ServiceContextListHelper.write( this, Messages.service_context );

                markHeaderEnd(); //use padding if GIOP minor == 2

                break;
            }
            default :
            {
                throw new MARSHAL( "Unknown GIOP minor: " + giop_minor );
            }
        }
    }
View Full Code Here

     * @param littleEndian true if the character is to be read low end first
     * @return the wide character.
     */
    public char read_wchar( InputBuffer buffer, int giop_minor, boolean littleEndian )
    {
        throw new MARSHAL( "Bad wide char codeSet: " + getName() );
    }
View Full Code Here

     * @param littleEndian    true if the characters are to be read low end first
     * @return a string possibly containing wide characters.
     */
    public String read_wstring( InputBuffer buffer, int lengthIndicator, int giop_minor, boolean littleEndian )
    {
        throw new MARSHAL( "Bad wide char codeSet: " + getName() );
    }
View Full Code Here

        public char read_wchar( InputBuffer buffer, int giop_minor, boolean littleEndian )
        {
            if (giop_minor < 2)
            {
                throw new MARSHAL( "GIOP 1." + giop_minor +
                                   " only allows 2 Byte encodings for wchar, but the selected TCSW is UTF-8" );
            }

            short value = (short) (0xff & buffer.readByte());
View Full Code Here

        }


        public String read_wstring( InputBuffer source, int lengthIndicator, int giop_minor, boolean little_endian )
        {
            if (giop_minor < 2) throw new MARSHAL( "Bad wide char codeSet: " + getName() );
            return readGiop12WString( source, lengthIndicator, giop_minor );
        }
View Full Code Here

                break;
            }
            default :
            {
                throw new MARSHAL( "Unknown GIOP minor: " + giop_minor );
            }
        }
    }
View Full Code Here

        super( orb, buffer );

        //check message type
        if( Messages.getMsgType( buffer ) != MsgType_1_1._Reply )
        {
            throw new MARSHAL("Not a reply!");
        }

        switch( giop_minor )
        {
            case 0 :
            {
                //GIOP 1.0 = GIOP 1.1, fall through
            }
            case 1 :
            {
                //GIOP 1.1
                ReplyHeader_1_0 hdr =
                ReplyHeader_1_0Helper.read( this );

                body_start = pos;

                rep_hdr =
                new ReplyHeader_1_2( hdr.request_id,
                                     ReplyStatusType_1_2.from_int( hdr.reply_status.value() ),
                                     hdr.service_context );
                break;
            }
            case 2 :
            {
                //GIOP 1.2
                rep_hdr = ReplyHeader_1_2Helper.read( this );

                skipHeaderPadding();

                body_start = pos;

                break;
            }
            default : {
                throw new MARSHAL("Unknown GIOP minor version: " + giop_minor);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.omg.CORBA.MARSHAL

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.