Guardian@JUMPERZ.NET :Plugins :Examples :

Example 2

Prev Next

This plugin creates an HTTP response.

package net.jumperz.app.MGuardian.plugin;

import java.io.*;
import java.util.*;
import net.jumperz.net.*;

/**
* Plugin example
* This simple plugin creates an HTTP response
*/
public class MExample3
extends MGuardianPlugin
{
//--------------------------------------------------------------------------------
public Map execute( Map sessionInfo )
throws IOException
{
MHttpResponse response = new MHttpResponse();
response.setBody( "Hello Guardian Plugin." );
Map pluginResult = new HashMap();
pluginResult.put( "response", response );
return pluginResult;
}
//--------------------------------------------------------------------------------
}


When this plugin is executed, the client will see the string "Hello Guardian Plugin.". Because the plugin creates an HTTP response, Guardian@JUMPERZ.NET does not connect to the web server.

Examples