Package org.jboss.byteman.agent.submit

Examples of org.jboss.byteman.agent.submit.Submit


            // get the address/port from the plugin config - defaults will be null to force NPEs which is OK, because nulls are error conditions
            String address = pc.getSimpleValue(BytemanAgentDiscoveryComponent.PLUGIN_CONFIG_PROP_ADDRESS, null);
            String port = pc.getSimpleValue(BytemanAgentDiscoveryComponent.PLUGIN_CONFIG_PROP_PORT, null);

            this.bytemanClient = new Submit(address, Integer.valueOf(port).intValue());
        }

        return this.bytemanClient;
    }
View Full Code Here


     * them if need be.
     *
     * @throws Exception
     */
    protected void addDeployedClasspathJars() throws Exception {
        Submit client = getBytemanClient();
        List<String> paths = new ArrayList<String>();

        // do the boot jars first
        File dataDir = this.bootJarsDataDir;
        File[] files = dataDir.listFiles();
        if (files != null && files.length > 0) {
            List<String> loadedJars = client.getLoadedBootClassloaderJars();
            for (File file : files) {
                if (!loadedJars.contains(file.getAbsolutePath())) {
                    paths.add(file.getAbsolutePath());
                }
            }
            client.addJarsToBootClassloader(paths);
        }

        // now do the system jars
        paths.clear();
        dataDir = this.systemJarsDataDir;
        files = dataDir.listFiles();
        if (files != null && files.length > 0) {
            List<String> loadedJars = client.getLoadedSystemClassloaderJars();
            for (File file : files) {
                if (!loadedJars.contains(file.getAbsolutePath())) {
                    paths.add(file.getAbsolutePath());
                }
            }
            client.addJarsToSystemClassloader(paths);
        }

        return;
    }
View Full Code Here

    }

    public AvailabilityType getAvailability() {
        try {
            String ourKey = this.resourceContext.getResourceKey();
            Submit client = this.resourceContext.getParentResourceComponent().getBytemanClient();
            List<String> rules = this.resourceContext.getParentResourceComponent().getRules();
            for (String rule : rules) {
                String ruleName = client.determineRuleName(rule);
                if (ourKey.equals(ruleName)) {
                    return AvailabilityType.UP;
                }
            }
            return AvailabilityType.DOWN;
View Full Code Here

                    Thread.currentThread().getContextClassLoader().getResourceAsStream(BytemanConfiguration.BYTEMAN_CONFIG)
                );
                String ruleKey = Thread.currentThread().getName();
                String ruleScript = GenerateScriptUtil.toString(scriptStream);
                try {
                    Submit submit = new Submit(Submit.DEFAULT_ADDRESS, config.containerAgentPort());
                    submit.addScripts(Arrays.asList(new ScriptText(ruleKey, ruleScript)));
                } catch (Exception e) {
                    throw new SubmitException("Could not install script from file", e);
                }
            }
        } catch (IOException e) {
View Full Code Here

            );

            String ruleKey = Thread.currentThread().getName();
            String ruleScript = GenerateScriptUtil.toString(scriptStream);
            try {
                Submit submit = new Submit(Submit.DEFAULT_ADDRESS, config.containerAgentPort());
                submit.deleteScripts(Arrays.asList(new ScriptText(ruleKey, ruleScript)));
            } catch (Exception e) {
                throw new SubmitException("Could not uninstall script from file", e);
            }
        }
    }
View Full Code Here

* @version $Revision: $
*/
public class SubmitUtil {
    public static void install(String key, String script, ExecContext context) {
        try {
            Submit submit = new Submit(context.getAddress(), context.getPort());
            submit.addScripts(Arrays.asList(new ScriptText(key, script)));
        } catch (Exception e) {
            throw new SubmitException("Could not install script from file", e);
        }
    }
View Full Code Here

        }
    }

    public static void uninstall(String key, String script, ExecContext context) {
        try {
            Submit submit = new Submit(context.getAddress(), context.getPort());
            submit.deleteScripts(Arrays.asList(new ScriptText(key, script)));
        } catch (Exception e) {
            throw new SubmitException("Could not uninstall script from file", e);
        }
    }
View Full Code Here

        this.registry = LocateRegistry.createRegistry(rmiRegistryPort);
    }

    public Instrumentor() throws RemoteException
    {
        this(new Submit(), DEFAULT_RMI_PORT);
    }
View Full Code Here

        this(new Submit(), DEFAULT_RMI_PORT);
    }

    public Instrumentor(String address, int port) throws RemoteException
    {
        this(new Submit(address, port), DEFAULT_RMI_PORT);
    }
View Full Code Here

        this(new Submit(address, port), DEFAULT_RMI_PORT);
    }

    public Instrumentor(String address, int port, int rmiPort) throws RemoteException
    {
        this(new Submit(address, port), rmiPort);
    }
View Full Code Here

TOP

Related Classes of org.jboss.byteman.agent.submit.Submit

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.