Package org.jgroups.conf

Examples of org.jgroups.conf.ClassConfigurator


        }
        return addr;
    }

    private static Address readOtherAddress(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
        ClassConfigurator conf=null;
        try {conf=ClassConfigurator.getInstance(false);} catch(Exception e) {}
        int b=in.read();
        int magic_number;
        String classname;
        Class cl=null;
        Address addr;
        if(b == 1) {
            magic_number=in.readInt();
            cl=conf.get(magic_number);
        }
        else {
            classname=in.readUTF();
            cl=conf.get(classname);
        }
        addr=(Address)cl.newInstance();
        addr.readFrom(in);
        return addr;
    }
View Full Code Here


        addr.readFrom(in);
        return addr;
    }

    private static void writeOtherAddress(Address addr, DataOutputStream out) throws IOException {
        ClassConfigurator conf=null;
        try {conf=ClassConfigurator.getInstance(false);} catch(Exception e) {}
        int magic_number=conf != null? conf.getMagicNumber(addr.getClass()) : -1;

        // write the class info
        if(magic_number == -1) {
            out.write(0);
            out.writeUTF(addr.getClass().getName());
View Full Code Here

        }
        return addr;
    }

    private static Address readOtherAddress(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
        ClassConfigurator conf;
        try {
            conf=ClassConfigurator.getInstance(false);
        }
        catch(ChannelException e) {
            IllegalAccessException new_ex=new IllegalAccessException();
            new_ex.initCause(e);
            throw new_ex;
        }
        int b=in.read();
        short magic_number;
        String classname;
        Class cl=null;
        Address addr;
        if(b == 1) {
            magic_number=in.readShort();
            cl=conf.get(magic_number);
        }
        else {
            classname=in.readUTF();
            cl=conf.get(classname);
        }
        addr=(Address)cl.newInstance();
        addr.readFrom(in);
        return addr;
    }
View Full Code Here

        addr.readFrom(in);
        return addr;
    }

    private static void writeOtherAddress(Address addr, DataOutputStream out) throws IOException {
        ClassConfigurator conf=null;
        try {
            conf=ClassConfigurator.getInstance(false);
        }
        catch(ChannelException e) {
            IOException new_ex=new IOException();
            new_ex.initCause(e);
            throw new_ex;
        }
        short magic_number=conf != null? conf.getMagicNumber(addr.getClass()) : -1;

        // write the class info
        if(magic_number == -1) {
            out.write(0);
            out.writeUTF(addr.getClass().getName());
View Full Code Here

        }
        return addr;
    }

    private static Address readOtherAddress(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
        ClassConfigurator conf;
        try {
            conf=ClassConfigurator.getInstance(false);
        }
        catch(ChannelException e) {
            IllegalAccessException new_ex=new IllegalAccessException();
            new_ex.initCause(e);
            throw new_ex;
        }
        int b=in.read();
        short magic_number;
        String classname;
        Class cl=null;
        Address addr;
        if(b == 1) {
            magic_number=in.readShort();
            cl=conf.get(magic_number);
        }
        else {
            classname=in.readUTF();
            cl=conf.get(classname);
        }
        addr=(Address)cl.newInstance();
        addr.readFrom(in);
        return addr;
    }
View Full Code Here

        addr.readFrom(in);
        return addr;
    }

    private static void writeOtherAddress(Address addr, DataOutputStream out) throws IOException {
        ClassConfigurator conf=null;
        try {
            conf=ClassConfigurator.getInstance(false);
        }
        catch(ChannelException e) {
            IOException new_ex=new IOException();
            new_ex.initCause(e);
            throw new_ex;
        }
        short magic_number=conf != null? conf.getMagicNumber(addr.getClass()) : -1;

        // write the class info
        if(magic_number == -1) {
            out.write(0);
            out.writeUTF(addr.getClass().getName());
View Full Code Here

        }
        return addr;
    }

    private static Address readOtherAddress(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
        ClassConfigurator conf;
        try {
            conf=ClassConfigurator.getInstance(false);
        }
        catch(ChannelException e) {
            IllegalAccessException new_ex=new IllegalAccessException();
            new_ex.initCause(e);
            throw new_ex;
        }
        int b=in.read();
        short magic_number;
        String classname;
        Class cl=null;
        Address addr;
        if(b == 1) {
            magic_number=in.readShort();
            cl=conf.get(magic_number);
        }
        else {
            classname=in.readUTF();
            cl=conf.get(classname);
        }
        addr=(Address)cl.newInstance();
        addr.readFrom(in);
        return addr;
    }
View Full Code Here

        addr.readFrom(in);
        return addr;
    }

    private static void writeOtherAddress(Address addr, DataOutputStream out) throws IOException {
        ClassConfigurator conf=null;
        try {
            conf=ClassConfigurator.getInstance(false);
        }
        catch(ChannelException e) {
            IOException new_ex=new IOException();
            new_ex.initCause(e);
            throw new_ex;
        }
        short magic_number=conf != null? conf.getMagicNumber(addr.getClass()) : -1;

        // write the class info
        if(magic_number == -1) {
            out.write(0);
            out.writeUTF(addr.getClass().getName());
View Full Code Here

        }
        return addr;
    }

    private static Address readOtherAddress(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
        ClassConfigurator conf;
        try {
            conf=ClassConfigurator.getInstance(false);
        }
        catch(ChannelException e) {
            IllegalAccessException new_ex=new IllegalAccessException();
            new_ex.initCause(e);
            throw new_ex;
        }
        int b=in.read();
        short magic_number;
        String classname;
        Class cl=null;
        Address addr;
        if(b == 1) {
            magic_number=in.readShort();
            cl=conf.get(magic_number);
        }
        else {
            classname=in.readUTF();
            cl=conf.get(classname);
        }
        addr=(Address)cl.newInstance();
        addr.readFrom(in);
        return addr;
    }
View Full Code Here

        addr.readFrom(in);
        return addr;
    }

    private static void writeOtherAddress(Address addr, DataOutputStream out) throws IOException {
        ClassConfigurator conf=null;
        try {
            conf=ClassConfigurator.getInstance(false);
        }
        catch(ChannelException e) {
            IOException new_ex=new IOException();
            new_ex.initCause(e);
            throw new_ex;
        }
        short magic_number=conf != null? conf.getMagicNumber(addr.getClass()) : -1;

        // write the class info
        if(magic_number == -1) {
            out.write(0);
            out.writeUTF(addr.getClass().getName());
View Full Code Here

TOP

Related Classes of org.jgroups.conf.ClassConfigurator

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.