All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.freedesktop.dbus.connections.GlobalHandler Maven / Gradle / Ivy

Go to download

Improved version of the DBus-Java library provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/).

There is a newer version: 5.1.0
Show newest version
package org.freedesktop.dbus.connections;

import org.freedesktop.dbus.errors.UnknownObject;
import org.freedesktop.dbus.messages.ExportedObject;

public class GlobalHandler implements org.freedesktop.dbus.interfaces.Peer, org.freedesktop.dbus.interfaces.Introspectable {
    /**
     * 
     */
    private AbstractConnection connection;
    private String objectpath;

    GlobalHandler(AbstractConnection _abstractConnection) {
        connection = _abstractConnection;
        this.objectpath = null;
    }

    GlobalHandler(AbstractConnection _abstractConnection, String _objectpath) {
        connection = _abstractConnection;
        this.objectpath = _objectpath;
    }

    @Override
    public boolean isRemote() {
        return false;
    }

    @Override
    public void Ping() {
        return;
    }

    @Override
    public String Introspect() {
        String intro = connection.getObjectTree().Introspect(objectpath);
        if (null == intro) {
            ExportedObject eo = connection.getFallbackContainer().get(objectpath);
            if (null != eo) {
                intro = eo.getIntrospectiondata();
            }
        }
        if (null == intro) {
            throw new UnknownObject("Introspecting on non-existant object");
        } else {
            return "\n" + intro;
        }
    }

    @Override
    public String getObjectPath() {
        return objectpath;
    }

    @Override
    public String GetMachineId() {
        return connection.getMachineId();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy