class SmsTask implements Runnable
    {
        private final ObjectPool<SMPPSession> sessionPool;

        // Settings that apply to source of an SMS message.
        private final TypeOfNumber sourceTon = JiveGlobals.getEnumProperty( "sms.smpp.source.ton", TypeOfNumber.class, TypeOfNumber.UNKNOWN );
        private final NumberingPlanIndicator sourceNpi = JiveGlobals.getEnumProperty( "sms.smpp.source.npi", NumberingPlanIndicator.class, NumberingPlanIndicator.UNKNOWN );
        private final String sourceAddress = JiveGlobals.getProperty( "sms.smpp.source.address" );

        // Settings that apply to destination of an SMS message.
        private final TypeOfNumber destinationTon = JiveGlobals.getEnumProperty( "sms.smpp.destination.ton", TypeOfNumber.class, TypeOfNumber.UNKNOWN );
        private final NumberingPlanIndicator destinationNpi = JiveGlobals.getEnumProperty( "sms.smpp.destination.npi", NumberingPlanIndicator.class, NumberingPlanIndicator.UNKNOWN );

        private final String destinationAddress;
        private final byte[] message;

        // Non-configurable defaults (for now - TODO?)
        private final ESMClass esm = new ESMClass();
        private final byte protocolId = 0;
        private final byte priorityFlag = 1;
        private final String serviceType = "CMT";
        private final String scheduleDeliveryTime = timeFormatter.format( new Date() );
        private final String validityPeriod = null;
        private final RegisteredDelivery registeredDelivery = new RegisteredDelivery( SMSCDeliveryReceipt.DEFAULT );
        private final byte replaceIfPresentFlag = 0;
        private final DataCoding dataCoding = new GeneralDataCoding( Alphabet.ALPHA_DEFAULT, MessageClass.CLASS1, false );
        private final byte smDefaultMsgId = 0;


        SmsTask( ObjectPool<SMPPSession> sessionPool, String message, String destinationAddress )
        {
            this.sessionPool = sessionPool;
            this.message = message.getBytes();
            this.destinationAddress = destinationAddress;
        }

        @Override
        public void run()
        {<FILL_FUNCTION_BODY>}

        public void sendMessage() throws Exception
        {
            final SMPPSession session = sessionPool.borrowObject();
            try
            {
                final String messageId = session.submitShortMessage(
                    serviceType,
                    sourceTon, sourceNpi, sourceAddress,
                    destinationTon, destinationNpi, destinationAddress,
                    esm, protocolId, priorityFlag,
                    scheduleDeliveryTime, validityPeriod, registeredDelivery, replaceIfPresentFlag,
                    dataCoding, smDefaultMsgId, message );
                Log.debug( "Message submitted, message_id is '{}'.", messageId );
            }
            finally
            {
                sessionPool.returnObject( session );
            }
        }
    }

            try
            {
                sendMessage();
            }
            catch ( Exception e )
            {
                Log.error( "An exception occurred while sending a SMS message (to '{}')", destinationAddress, e );
            }
        
<no_super_class>