made the adapter singleton and passed a value frmo java to c