Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

HTTP and Other TCP Servers

public class rServerRegistrar {

public Thread[] cthreads;

public rServerRegistrar(Thread thr) {
cthreads=new Thread[1];
cthreads[0]=thr;
}

public void registerThread(Thread newthread) {
Thread[] tempthreads=new Thread[cthreads.length+1];
for(int i=0;i<cthreads.length;i++) {
tempthreads[i]=cthreads[i];
}
tempthreads[cthreads.length]=newthread;
cthreads=tempthreads;
}

public void deregisterThread(Thread delthread) {
Thread[] tempthreads=new Thread[cthreads.length-1];
int count=0;
for(int i=0;i<cthreads.length;i++) {
if(delthread.getName()!=cthreads[i].getName()) {
tempthreads[count]=cthreads[i];
count++;
}
}
cthreads=tempthreads;
}

private void updateThreads() {
int count=0; // First count the number of alive threads.
for(int i=0;i<cthreads.length;i++) {
if(cthreads[i].isAlive()) count++;
}
Thread[] temp=new Thread[count];
count=0;
for(int i=0;i<cthreads.length;i++) {
if(cthreads[i].isAlive()) {
temp[count]=cthreads[i];
count++;
}
}
}

public Thread[] getClientThreads() {
updateThreads(); // Return all except first thread.
Thread[] temp=new Thread[cthreads.length-1];
for(int i=0;i<temp.length;i++) {
temp[i]=cthreads[i+1];
}
return temp;
}

}

XML introduction

XML, the Extensible Markup Language, has gone from the latest buzzword to an entrenched eBusiness technology in record time. This newly revised tutorial discusses what XML is, why it was developed, and how it's shaping the future of electronic commerce. It also covers a variety of important XML programming interfaces and standards, and ends with two case studies showing how companies are using XML to solve business problems.

  • Why XML was created
  • The rules of XML documents
  • How to define what an XML document can and cannot contain
  • Programming interfaces that work with XML documents
  • What the main XML standards are and how they work together
  • How companies are using XML in the real world

Applications of XML

Although there are countless numbers of applications that use XML, here are a few examples of the current platforms and applications that are making use of this technology:
  • Cell Phones - XML data is sent to some cell phones. The data is then formatted by the specification of the cell phone software designer to display text or images, and even to play sounds!
  • File Converters - Many applications have been written to convert existing documents into the XML standard. An example is a PDF to XML converter.
  • VoiceXML - Converts XML documents into an audio format so that you can listen to an XML document.

comments