Examples of DBusConnection


Examples of org.freedesktop.dbus.DBusConnection

    * @param args
    */
   public static void main(String[] args)
   {

      DBusConnection client = null;

      try
      {
         client = DBusConnection.getConnection(DBusConnection.SYSTEM);

         // Get the remote object
         SGDataTransfer dataTransfer =
               (SGDataTransfer) client.getRemoteObject("SYSTEM", S_G_DATA_TRANSFER_OBJECT_PATH,
                     SGDataTransfer.class);

         if (dataTransfer == null)
         {
            System.out.println("null object returned");
            System.exit(0);
         }

         // Call methods on it
         dataTransfer.serviceResponse("", "", 0, new byte[0], 0, 0);
         //dataTransfer.sendDataIn("", "", 0, new byte[2]);
      }
      catch (DBusException e)
      {
         e.printStackTrace();
      }
      finally
      {
         if (client != null)
         {
            System.out.println("disconnecting client");
            client.disconnect();
         }
      }

   }
View Full Code Here

Examples of org.freedesktop.dbus.DBusConnection

    public AvailabilityType getAvailability() {
        return AvailabilityType.UP;
    }

    private void setupServices() throws Exception {
        DBusConnection conn = null;
        try {
            conn = DBusConnection.getConnection(DBusConnection.SYSTEM);
            sysVServices = ServiceManager.instance().listSysVServices(conn);
            xinetdServices = ServiceManager.instance().listXinetdServices(conn);
        } finally {
            if (conn != null) {
                conn.disconnect();
            }
        }
    }
View Full Code Here

Examples of org.freedesktop.dbus.DBusConnection

 
  public static void main(String[] args) throws DBusException {
    //ReceivingImMsg_Handler ringh = new ReceivingImMsg_Handler();
    //ReceivedImMsg_Handler rdh = new ReceivedImMsg_Handler();
   
    DBusConnection conn = DBusConnection.getConnection(DBusConnection.SESSION);
    PurpleInterface po = (PurpleInterface)conn.getRemoteObject("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject");
    FileHandler fh = new FileHandler(po,conn, "agent_file_", ".tmp");
    //conn.addSigHandler(im.pidgin.purple.PurpleInterface.FileSendStart.class, fh);
    //conn.addSigHandler(im.pidgin.purple.PurpleInterface.FileSendComplete.class, fh);
   
    byte[] orgArr = new byte[]{'c','d','w','h','d','l'};
View Full Code Here

Examples of org.freedesktop.dbus.DBusConnection

  @Override
  public void handle(ReceivedImMsg sig) {
    PurpleInterface.ReceivedImMsg rsig = (PurpleInterface.ReceivedImMsg) sig;
    System.out.println("Caught a ReceivedImMsg signal!");
    try {
    DBusConnection conn = DBusConnection.getConnection(DBusConnection.SESSION);
    PurpleInterface po = (PurpleInterface)conn.getRemoteObject("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject");
    String al = po.PurpleBuddyGetAlias(po.PurpleFindBuddy(rsig.a, rsig.b));
   
    po.PurpleConvImSendWithFlags(po.PurpleConversationGetImData(sig.d), "can you read this dear Christoph?", 0x8000);
   
    System.out.println("Wrote invisible");
View Full Code Here

Examples of org.freedesktop.dbus.DBusConnection

  public String temp;
  @Override
  public void handle(ReceivingImMsg sig) {   
    System.out.println("Caught a ReceivingImMsg signal!");
    //sig.c="hanihani";
    DBusConnection conn;
    try {
      conn = DBusConnection.getConnection(DBusConnection.SESSION);
      PurpleInterface po = (PurpleInterface)conn.getRemoteObject("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject");
      System.out.println("The message is:" + sig.c);
      //po.PurpleConversationDestroy(sig.d);
      this.temp+= sig.c;
      //byte[] decoded = Base64.decodeBase64(this.temp.getBytes());
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.