Click here to Skip to main content
15,895,667 members
Articles / Programming Languages / Visual Basic

Oracle Advance Queue or Advanced Queuing from .NET (C#/VB/MC++)

Rate me:
Please Sign up or sign in to vote.
4.88/5 (26 votes)
22 Nov 2005CPOL23 min read 177.9K   3.7K   71  
How to use Oracle advance queue from a .NET enviroment.
//
//  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
//  PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER 
//  REMAINS UNCHANGED.
//
//  Email:  gustavo_franco@hotmail.com
//
//  Copyright (C) 2005 Franco, Gustavo 
//
#pragma once
#include "windows.h"
#include "stdio.h"
#include <iostream>
#include <process.h>		
#include <oracl.h>

#include "AQException.h"
#include "AQTools.h"

using namespace System;
using namespace System::Threading;
using namespace System::Diagnostics;

namespace AQLib
{
	#ifndef __AQConsumer__
	#define __AQConsumer__
	public __gc __abstract class AQConsumer
	{
	private:
		static bool				mTracingEnabled;
		bool					mExit;

	protected:
		Object*					mPayload;
		Thread*					mRunningThread;
		AutoResetEvent*			mResetEvent;
		bool					mItemProcessed;
		~AQConsumer();

	private public:
		static int		ERROR_UNKNOW  = -9999;
		static String*	SERROR_UNKNOW = "Unknow Error, Check for inner exception";

	protected public:
		AQConsumer();
		__property bool get_ItemProcessed();
		__property Thread* get_RunningThread();
		__property void set_RunningThread(Thread* runningThread);
		__property Object* get_Payload();
		__property void set_Payload(Object* payload);
		
		void Start();
		bool Stop(bool softStop);

	public:
		__property static bool get_TracingEnabled();
		__property static void set_TracingEnabled(bool enabled);

		//This method will be called when a payload is received
		virtual void ProcessPayload(Object *payload) = 0;
	};
	#endif
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
United States United States
I started with programming about 19 years ago as a teenager, from my old Commodore moving to PC/Server environment Windows/UNIX SQLServer/Oracle doing gwBasic, QBasic, Turbo Pascal, Assembler, Turbo C, BC, Summer87, Clipper, Fox, SQL, C/C++, Pro*C, VB3/5/6, Java, and today loving C#.

Currently working as SDE on Failover Clustering team for Microsoft.

Passion for most programming languages and my kids Aidan&Nadia.

Comments and Discussions