- 浏览: 142448 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (95)
- java (25)
- 数据库 (9)
- js (0)
- 框架 (10)
- 小问题 (8)
- 转载 (2)
- 配置开发环境 (6)
- 其它 (4)
- 功能记录 (2)
- 安全 (1)
- shell (3)
- spring ibaitis struts2 redis desc (1)
- spring security3.1 (1)
- 小问题 环境 (1)
- 小问题 环境 DelegatingFilterProxy cannot be cast to Filter (0)
- redis filter java (1)
- java redis (2)
- spring quartz 集群 批处理 (1)
- java mybatis (1)
- Junit soap (1)
- mock junit (0)
- mock junit spring (1)
- java jsoup (0)
- jsoup (1)
- python27 pycharm (1)
- maven pom (1)
- java log (1)
- mybatis 分页 (1)
- mysql (1)
- 业务 (1)
- java 测试 (1)
- java zookeeper 批处理 (1)
- hive hadoop (1)
- hive (1)
- hadoop (1)
- maven archetype (1)
- python rsa (1)
- python 页面分析 (1)
- python (0)
最新评论
-
wuyafeng123:
秒杀活动设计思路 -
indiajohns:
非常感谢,很快解决了我的问题
jmesa查询条件中文的编码转换问题 -
yujiaao:
太好了,感谢啊!这行在我这好象不行:URLDecoder.de ...
jmesa查询条件中文的编码转换问题 -
michael_wong:
呵呵,找到啦。在这里有全部源码:http://ishare. ...
Maven权威指南 的simple-parent 工程源码 -
michael_wong:
我也在找啊
Maven权威指南 的simple-parent 工程源码
先启动进程HttpProcesser,等请求到达后加入socket对象并执行process().tomcat5.5以及后续版本已经没有看到HttpProcesser对象了
package com.xly; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; public class HttpConnecter { public static void main(String... args){ try { Socket sk=null; HttpConnecter hc=new HttpConnecter(); HttpProcesser hp=new HttpProcesser(hc,sk); hp.start(); ServerSocket socketserver=new ServerSocket(8888,60000); sk=socketserver.accept(); hp.assign(sk); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
package com.xly; import java.net.Socket; public class HttpProcesser extends Thread{ public boolean available = false; public boolean stopped = false; public Socket socket; public HttpConnecter httpconnecter; public HttpProcesser(HttpConnecter httpconnecter,Socket socket) { this.available = false; this.socket=socket; this.httpconnecter=httpconnecter; } public void setAvailable(boolean available){ this.available=available; } private synchronized Socket await() { // Wait for the Connector to provide a new Socket while (!available) { try { wait(); } catch (InterruptedException e) { } } // Notify the Connector that we have received this Socket Socket socket = this.socket; available = false; notifyAll(); if ((socket != null)) System.out.println("The incoming request has been awaited"); return (socket); } synchronized void assign(Socket socket) { // Wait for the Processor to get the previous Socket while (available) { try { wait(); } catch (InterruptedException e) { } } // Store the newly available Socket and notify our thread this.socket = socket; available = true; notifyAll(); if ((socket != null)) System.out.println("An incoming request is being assigned"); } public void process(Socket sockets) { System.out.println("process.run"); } public void run() { // Process requests until we receive a shutdown signal while (!stopped) { System.out.println("Thread Run"); // Wait for the next socket to be assigned Socket socket = await(); if (socket == null) continue; // Process the request from this socket try { process(socket); } catch (Throwable t) { System.out.print("process.invoke"); } // Finish up this request // connector.recycle(this); } // Tell threadStop() we have shut ourselves down successfully } }
发表评论
-
详解ReentrantReadWriteLock
2016-04-21 14:34 0package java.util.concurrent. ... -
java内部类使用场景体会
2016-04-21 11:56 912内部类的作用: 1.完善多重继承。 疑问在于:多重继承可以用 ... -
logBack用法,记录
2015-11-24 15:37 9921. Logback使用手册 系统中的日志采用 slf4j ... -
表产生sequence功能,测试并发
2015-11-18 16:21 616@Test public void testSerial ... -
Demo
2014-11-03 21:20 0package com.xly.jsoup.nbjy; /* ... -
反射小计
2014-10-07 11:32 489Test.java方法dd重载 class Test{ ... -
Btrace测试
2014-07-17 17:56 599偶尔看到BTrace,必须记录一下 利用hotSpot虚拟机 ... -
java对象占用heap的大小
2013-07-31 10:09 906一个对象占用的堆空间首先是和它有多少个成员变量直接相关 pub ... -
BeanCopier和BeanUtils实现对象复制,处理date类型
2013-03-29 12:52 4376没有废话 先是BeanUtils的实现类型: impo ... -
liferay 为JournalArticle添加分类
2013-03-21 15:45 1056/** * 为网页内容添加分类 ... -
liferay直接跳转到网页内容编辑页面修改的friendlyUrl效果
2013-03-21 14:11 1209找到portlat-impl.jar包,在目录 port ... -
JMS_DEMO
2013-03-14 20:25 14671.安装activeMq 修改service.pr ... -
Xmemcached/jedis springdemo
2013-02-20 13:13 893Xmemcached: HelloWordTest.ja ... -
规则检查功能的demo
2013-01-31 12:55 0规则检查Demo,包括mina,线程池功能 -
使用spring的线程安全web应用(翻译Thread-safe webapps using Spring)
2013-01-11 16:38 1871http://www.javalobby.org/articl ... -
JAVA虚拟机锁机制的升级流程
2013-01-08 14:52 2833http://ifeve.com/java-synchroni ... -
NIO学习
2012-11-27 11:49 1460最需要关注的是,应用进程、内核、IO三个概念。 所谓java的 ... -
web.xml加载
2011-02-18 17:24 881转: web.xml文件内容加载顺序为:context- pa ... -
Maven权威指南 的simple-parent 工程源码
2010-11-30 10:12 1536未能找到全部源码,知道的朋友请分享。 -
webLogic中 Cannot parse POST parameters of request: 的问题小记
2010-11-25 13:25 7760报错内容: weblogic.utils.NestedRunt ...
相关推荐
Connector/Net is a fully-managed ADO.NET driver for MySQL. 支持64位操作系统
MySQL Connector/J jdbc 驱动 通过JDBC驱动,MySQL提供了与使用Java编程语言开发的客户端应用程序的连通性,该驱动称为MySQL Connector/J。
MariaDB Connector/Python(mariadb-connector-python-1.0.7.zip)
MySQL Connector/Ne 6.10.1 需要 .Net Framework 4.5.1 或更高版本支持。 MySQL Connector Net 6.10.2 到最新的 MySQL Connector Net 8.0.20 需要 .Net Framework 4.5.2 或更高版本。 MySQL Connector/...
MariaDB Connector/ODBC(mariadb-connector-odbc-3.1.13-src.zip)
DB MySQL Connector/C x64 v6.1 便携版 DB MySQL Connector/C x64 v6.1 Portable
mysql Connector/ODBC 5.2.4 官网下载 x86 x64都有
MySQL Connector/J. MySQL Connector/J is a JDBC-3.0 Type 4 driver, which means that is pure Java, implements version 3.0 of the JDBC specification, and communicates directly with the MySQL server using...
mysql-connector-java-5.1.31.tar.gz mysql官网地址http://dev.mysql.com/downloads/connector/j/ (mysql-connector-java-5.1.31.tar.gz) MD5: f655c14dde5b9484bf705ef5d49b3b39 | Signature
MariaDB Connector/J (mariadb-java-client-2.7.3-sources.jar)
MariaDB Connector/C(mariadb-connector-c-3.1.13-src.zip)
Connector/Net is a fully-managed ADO.NET driver for MySQL. MySql 的 ADO.NET 驱动 版本 6.3.5.0 适用于 .net 4.0
MySQL Connector/Net, .Net 处理MySQL, 连接器/ .NET允许您轻松开发需要与MySQL安全、高性能数据连接的.NET应用程序。它实现了所需的ADO.NET接口和集成到ADO.NET感知的工具。开发人员可以使用他们选择的.NET语言构建...
使用C#操作数据库,这是从mysql官网下载,值得信赖,一贯免积分下载! Happy Coding ,Enjoy Yourself !!!
http://www.mysql.com/downloads/connector/python/ Windows (x86, 32-bit ver. 3.3), MSI Installer 1.0.9 0.3M Download (mysql-connector-python-1.0.9-py3.3.msi) MD5: 92816bfb40343d508808ea86a400e709 | ...
This manual describes how to install, configure, and develop database applications using MySQL Connector/ J 5.1, a JDBC driver for communicating with MySQL servers. It also contains information on ...
MySQL Connector/Python Revealed: SQL and NoSQL Data Storage Using MySQL for Python Programmers By 作者: Jesper Wisborg Krogh ISBN-10 书号: 1484236939 ISBN-13 书号: 9781484236932 Edition 版本: 1st ed...
Connector/c++ 库的源文件。编译方法可看这里:http://www.cnblogs.com/sixbeauty/p/4749827.html
MySQL Connector/ODBC 8.0 is recommended for use with MySQL Server 8.0, 5.7, 5.6, and 5.5. Please upgrade to MySQL Connector/ODBC 8.0.