Share this page

# LrJposChannel.getConfiguration

Gets the configuration associated with the channel.

`public static Configuration getConfiguration() throws ConfigurationException`

## Return values

This function returns an org.jpos.core.Configuration object.

It returns null if the configuration is not set.

## Example

Copy code

    public void simpleISOtest_config() throws Throwable{

            GenericPackager packager = new GenericPackager(PACKAGERCONFIGFILE);
            LrJposChannel.initChannel(LrJposChannel.ChannelType.ASCIIChannel);
            LrJposChannel.setPackager(packager);

            Properties props = new Properties();
            props.put("host","localhost");
            props.put("port", "8000");

            LrJposChannel.setConfiguration(new SimpleConfiguration(props));

            LrJposChannel.connect();

            LrISOMsg m = new LrISOMsg();
            m.setMTI("0100");
            m.set(ISO87Fields.PAN_PRIMARY_ACCOUNT_NUMBER, "1234567890000000000");
            m.set(3, "523456");
            m.set(4, "123456789121");
            m.set(12, "20241605108110"); //Date and time - n-14, CCYYMMDDhhmmss
            m.set(47, "32432");

            LrJposChannel.send(m);

            LrISOMsg r = LrJposChannel.receive();
            if (r!=null) {
                lr.output_message(r.getMTI());
            }

            Configuration cfg = LrJposChannel.getConfiguration();

            LrJposChannel.disconnect();
            LrJposChannel.closeChannel();
    }

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: