Package org.apache.geronimo.interop

Examples of org.apache.geronimo.interop.SystemException


                String value = entry.getValue().toString().trim();
                map.put(key, value);
            }
            return map;
        } catch (Exception ex) {
            throw new SystemException(ex);
        }
    }
View Full Code Here


            byte[] buffer = bs.toByteArray();
            os.close();
            bs.close();
            return buffer;
        } catch (Exception ex) {
            throw new SystemException("JavaObject.toByteArray", ex);
        }
    }
View Full Code Here

            Object object = is.readObject();
            is.close();
            bs.close();
            return object;
        } catch (Exception ex) {
            throw new SystemException("JavaObject.fromByteArray", ex);
        }
    }
View Full Code Here

                    }
                }
            }

            if (sc == null) {
                throw new SystemException("Error: Unable to load stub for remote interface: " + remoteInterface);
            }

            java.lang.Object sobj = sc.newInstance();

            if (!(sobj instanceof ObjectRef)) {
                throw new SystemException("Error: Stub for remote interface: '" + remoteInterface + "' is not a valid ObjectRef.");
            }

            return (ObjectRef) sobj;
            //return (ObjectRef)sc.getInstance.invoke(sc.stubClass, ArrayUtil.EMPTY_OBJECT_ARRAY);
        } catch (Exception ex) {
            throw new SystemException(ex);
        }
    }
View Full Code Here

                    {
                        clen = java.lang.Integer.parseInt(str);
                    }
                    catch(Exception e)
                    {
                        throw new SystemException(e.toString());
                    }
                    cLenRead = true;
                }
            }
        }

        if(!cLenRead)
        {
            throw new SystemException("HTTP Post: Missing content-length");
        }

        java.io.InputStream msgInput = input;
        if(ver == 1)
        {
View Full Code Here

        int count = http_read_line(input, 12);
        String str = new String(_buffer, 0, count);
        int index = str.indexOf("/HIOP/1.0/");
        if(index == -1)
        {
            throw new SystemException("HTTP Tunnelling: HIOP version error");
        }

        index += 10;
        if( index >= count)
        {
            throw new SystemException("HTTP Tunneling: GET message error");
        }

        byte[] giopdata = org.apache.geronimo.interop.util.Base16Binary.fromString(str.substring(index));
        ByteArrayInputStream bi = new ByteArrayInputStream(giopdata);
View Full Code Here

        //read status: HTTP/1.1 200 OK
        int count = http_read_line(input, 0);
        String status = new String(_buffer, 0, count).toLowerCase();
        if(!status.startsWith("http/1.1") && !status.startsWith("http/1.0"))
        {
            throw new SystemException("HTTP response error");
        }

        if(status.indexOf("200") == -1 || status.indexOf("ok") == -1)
        {
            throw new SystemException("HTTP response error");
        }

        //skip headers and read content length
        boolean cLenRead = false;
        int clen = 0;

        while( (count = http_read_line(input, 0)) != 0)
        {
            if( (_buffer[0] == 'c' || _buffer[0] == 'C'))
            {
                String str = new String(_buffer, 0, count).toLowerCase();
                if(str.startsWith("content-length:"))
                {
                    str = str.substring(15).trim();
                    try
                    {
                        clen = java.lang.Integer.parseInt(str);
                    }
                    catch(Exception e)
                    {
                        throw new SystemException(e.toString());
                    }
                    cLenRead = true;
                }
            }
        }

        if(!cLenRead)
        {
            throw new SystemException("HTTP Post: Missing Content-Length");
        }

        //now read the iiop stream

        GiopMessage gm = receive_message(input, url, false);
View Full Code Here

        String str = new String(_buffer, 0, count);
        int index, ver;

        if((index = str.indexOf("HIOP")) == -1)
        {
            throw new SystemException("HTTP: Post Message - HIOP Version not specified");
        }
        else
        {
            //HIOP/1.0 or HIOP/2.0

            if((index + 8) > count)
            {
                throw new SystemException("HTTP: Post Message - Incorrect HIOP header");
            }

            index += 5;

            if(_buffer[index + 1] != '.' && _buffer[index + 2] != '0')
            {
                throw new SystemException("HTTP: Incorrect HIOP version");
            }

            if(_buffer[index] == '1')
            {
                ver = 1;
            }
            else if (_buffer[index] == '2')
            {
                ver = 2;
            }
            else
            {
                throw new SystemException("HTTP: Incorrect HIOP version");
            }
        }
        return ver;
    }
View Full Code Here

            int b;
            while ( (b = input.read()) != '\r' )
            {
                if(b == -1) //EOF has been reached
                {
                    throw new SystemException("HTTP: read error");
                }
                if(_buffer.length <= offset)
                {
                    byte[] newbuffer = new byte[offset*2];
                    System.arraycopy(_buffer, 0, newbuffer, 0, _buffer.length);
                    _buffer = newbuffer;

                }
                _buffer[offset++] = (byte)b;
            }

            // go past the \n character
            b = input.read();
            if ( b != '\n' )
            {
                throw new SystemException("HTTP CRLF combination missing");
            }
        }
        catch (java.io.IOException ex)
        {
            throw new SystemException(ex.toString());
        }
        return offset;
    }
View Full Code Here

                    break;
                case MsgType_1_1._LocateRequest:
                    processLocateRequest(output, inputMessage.locateRequest);
                    break;
                default:
                    throw new SystemException("TODO: message type = " + inputMessage.type);
            }

            if (sendResponse) {
                try {
                    if(inputMessage.httpTunneling)
View Full Code Here

TOP

Related Classes of org.apache.geronimo.interop.SystemException

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.