??xml version="1.0" encoding="utf-8" standalone="yes"?>
Retrieves a bitmask representing the currently available disk drives. Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or
network drive. To determine whether a drive is a USB-type drive, call SetupDiGetDeviceRegistryProperty and specify the
SPDRP_REMOVAL_POLICY property. The mciSendString function sends a command string to an MCI device.
The device that the command is sent to is specified in the command string mciSendString("set cdaudio door open",NULL,0,0); mciSendString("set cdaudio door closed",NULL,0,0); The Media Control Interface (MCI) provides standard commands for playing
multimedia devices and recording multimedia resource files. These commands are a
generic interface to nearly every kind of multimedia device. GetLogicalDrives Function
DWORD WINAPI GetLogicalDrives(void);
GetDriveType Function
UINT WINAPI GetDriveType(
__in LPCTSTR lpRootPathName
);
]]>MCI
Contains information that the system needs to process taskbar status area messages.
HANDLE WINAPI CreateToolhelp32Snapshot( __in DWORD dwFlags, __in DWORD th32ProcessID );
Process32First : 枚DW一个进E?/pre>Retrieves information about the first process encountered in a system snapshot.
BOOL WINAPI Process32First( __in HANDLE hSnapshot, __in_out LPPROCESSENTRY32 lppe );Process32Next : 递归枚D随后的进E?br>Retrieves information about the next process recorded in a system snapshot.
BOOL WINAPI Process32Next( __in HANDLE hSnapshot, __out LPPROCESSENTRY32 lppe );
举例Q假设有在一个应用系l中Q有一个共享的数据必须被ƈ发同时访问,首先Q将q个数据装在数据对象中Q称为Data ClassQ同Ӟ有多个讉Kc,专门用于在同一时刻讉Kq同一个数据对象?/p>
Z(jin)完成上述q发讉K同一资源的功能,需要引入锁Lock的概念,也就是说Q某个时刻,当有一个访问类讉Kq个数据对象Ӟq个数据对象必须上锁LockedQ用完后q卌锁unLockedQ再供其它访问类讉K?/p>
使用传统的编E习(fn)惯,我们?x)创Z个抽象类Q所有的讉Kcȝ承这个抽象父c,如下Q?/p>
abstract class Worker{ abstract void locked(); } |
因此Q一个新的程序结构应该是xpȝ的纵向切面,例如q个应用?#8220;?#8221;功能Q这个新的程序结构就是aspectQ方面)(j)
在这个应用中Q?#8220;?#8221;斚wQaspectQ应该有以下职责Q?/p>
提供一些必备的功能Q对被访问对象实现加锁或解锁功能。以保证所有在修改数据对象的操作之前能够调用lock()加锁Q在它用完成后Q调用unlock()解锁?/p>
AOP应用范围
很明显,AOP非常适合开发J2EE容器服务器,目前JBoss 4.0正是使用AOP框架q行开发?br> 具体功能如下Q?br>Authentication 权限
Caching ~存
Context passing 内容传?br>Error handling 错误处理
Lazy loading 懒加?br>Debugging 调试
logging, tracing, profiling and monitoring 记录跟踪 优化 校准
Performance optimization 性能优化
Persistence 持久?br>Resource pooling 资源?br>Synchronization 同步
Transactions 事务
AOP有必要吗Q?/strong>
当然Q上q应用范例在没有使用AOP情况下,也得C(jin)解决Q例如JBoss 3.XXX也提供了(jin)上述应用功能Q但是没有用AOP?/p>
但是Q用AOP可以让我们从一个更高的抽象概念来理解Y件系l,AOP也许提供一U有价值的工具。可以这么说Q因Z用AOPl构Q现在JBoss 4.0的源码要比JBoss 3.XҎ(gu)理解多了(jin)Q这对于一个大型复杂系l来说是非常重要的?/p>
从另外一个方面说Q好像不是所有的人都需要关?j)AOPQ它可能是一U架构设计的选择Q如果选择J2EEpȝQAOPx的上q通用斚w都已l被J2EE容器实现?jin),J2EE应用pȝ开发者可能需要更多地x行业应用斚waspect?/p>