Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 54360200BF9 for ; Sun, 4 Dec 2016 02:11:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 52C7C160B16; Sun, 4 Dec 2016 01:11:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 56595160B30 for ; Sun, 4 Dec 2016 02:11:46 +0100 (CET) Received: (qmail 38543 invoked by uid 500); 4 Dec 2016 01:11:44 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 37806 invoked by uid 99); 4 Dec 2016 01:11:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Dec 2016 01:11:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6ECD0F16B5; Sun, 4 Dec 2016 01:11:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: reta@apache.org To: commits@cxf.apache.org Date: Sun, 04 Dec 2016 01:12:12 -0000 Message-Id: <70c4012a8a214da8b1d0897c0be6bf0a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [30/30] cxf git commit: CXF-6882: Implement JAX-RS 2.1 NIO Proposal archived-at: Sun, 04 Dec 2016 01:11:48 -0000 CXF-6882: Implement JAX-RS 2.1 NIO Proposal Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cfc99443 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cfc99443 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cfc99443 Branch: refs/heads/CXF-6882.nio Commit: cfc9944348f35775e827cc39084336a08a01757b Parents: 0891162 Author: reta Authored: Tue Oct 18 19:44:31 2016 -0400 Committer: reta Committed: Sat Dec 3 20:10:32 2016 -0500 ---------------------------------------------------------------------- .../release/samples/jax_rs/nio_cdi/README.txt | 1 + .../main/release/samples/jax_rs/nio_cdi/pom.xml | 125 ++ .../java/demo/jaxrs/nio/BooksApplication.java | 44 + .../demo/jaxrs/nio/BooksRestServiceImpl.java | 69 + .../main/java/demo/jaxrs/nio/BooksServer.java | 45 + .../src/main/resources/META-INF/beans.xml | 10 + .../META-INF/cxf/org.apache.cxf.Logger | 1 + .../jax_rs/nio_cdi/src/main/resources/books.txt | 1270 ++++++++++++++++++ distribution/src/main/release/samples/pom.xml | 1 + .../cxf/cdi/JAXRSCdiResourceExtension.java | 2 +- .../cxf/jaxrs/impl/ResponseBuilderImpl.java | 11 +- .../jaxrs/nio/DelegatingNioOutputStream.java | 57 + .../nio/DelegatingNioServletOutputStream.java | 61 + .../org/apache/cxf/jaxrs/nio/NioFeature.java | 40 + .../apache/cxf/jaxrs/nio/NioInInterceptor.java | 91 ++ .../cxf/jaxrs/nio/NioMessageBodyWriter.java | 97 ++ .../apache/cxf/jaxrs/nio/NioWriteEntity.java | 40 + .../org/apache/cxf/jaxrs/nio/NioWriterImpl.java | 68 + .../transport/http/AbstractHTTPDestination.java | 23 +- .../cxf/systest/jaxrs/nio/NioBookStore.java | 69 + .../systest/jaxrs/nio/NioBookStoreServer.java | 69 + .../cxf/systest/jaxrs/nio/NioBookStoreTest.java | 70 + .../jaxrs/src/test/resources/files/books.txt | 1270 ++++++++++++++++++ 23 files changed, 3526 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/README.txt ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/README.txt b/distribution/src/main/release/samples/jax_rs/nio_cdi/README.txt new file mode 100644 index 0000000..048f01d --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/README.txt @@ -0,0 +1 @@ +http://localhost:8282/rest/api/books \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/pom.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/pom.xml b/distribution/src/main/release/samples/jax_rs/nio_cdi/pom.xml new file mode 100644 index 0000000..a0727bb --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/pom.xml @@ -0,0 +1,125 @@ + + 4.0.0 + JAX-RS NIO/CDI Demo (Jetty 9) + JAX-RS NIO/CDI Demo (Jetty 9) + jax_rs_nio_cdi + + + org.apache.cxf.samples + cxf-samples + 3.2.0-SNAPSHOT + ../.. + + + + UTF-8 + 9.3.5.v20151012 + + + + + javax.enterprise + cdi-api + + + + org.apache.cxf + cxf-integration-cdi + 3.2.0-SNAPSHOT + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + 3.2.0-SNAPSHOT + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + + + + com.fasterxml.jackson.core + jackson-core + + + + org.jboss.weld.servlet + weld-servlet + 2.2.16.Final + + + + org.jboss.weld + weld-core + 2.2.16.Final + + + + org.eclipse.jetty + jetty-server + + + + org.eclipse.jetty + jetty-plus + + + + org.eclipse.jetty + apache-jsp + ${cxf.jetty9.version} + + + + org.eclipse.jetty + jetty-webapp + + + + org.eclipse.jetty + jetty-webapp + + + + + + server + + test + + + org.codehaus.mojo + exec-maven-plugin + + + test + + java + + + demo.jaxrs.nio.BooksServer + + + + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksApplication.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksApplication.java b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksApplication.java new file mode 100644 index 0000000..9b0086c --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksApplication.java @@ -0,0 +1,44 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package demo.jaxrs.nio; + +import java.util.HashSet; +import java.util.Set; + +import javax.inject.Inject; +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +import org.apache.cxf.jaxrs.nio.NioFeature; + +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +@ApplicationPath( "api" ) +public class BooksApplication extends Application { + @Inject private BooksRestServiceImpl booksRestService; + + @Override + public Set getSingletons() { + final Set singletons = new HashSet<>(); + singletons.add(new NioFeature()); + singletons.add(booksRestService); + singletons.add(new JacksonJsonProvider()); + return singletons; + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksRestServiceImpl.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksRestServiceImpl.java b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksRestServiceImpl.java new file mode 100644 index 0000000..7d644e2 --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksRestServiceImpl.java @@ -0,0 +1,69 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package demo.jaxrs.nio; + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.apache.cxf.helpers.IOUtils; + +@Path("/books") +public class BooksRestServiceImpl { + @GET + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response readBooks(@QueryParam("path") String path) throws IOException { + final ByteArrayInputStream in = new ByteArrayInputStream( + IOUtils.readBytesFromStream(getClass().getResourceAsStream("/books.txt"))); + final byte[] buffer = new byte[4096]; + + return Response.ok().entity( + out -> { // writer handler + try { + final int n = in.read(buffer); + + if (n >= 0) { + out.write(buffer, 0, n); + return true; + } + + return false; + } catch (IOException ex) { + throw new WebApplicationException(ex); + } finally { + try { + in.close(); + } catch (IOException ex) { + /* do nothing */ + } + } + }, + throwable -> { + throw throwable; + } + ).build(); + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksServer.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksServer.java b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksServer.java new file mode 100644 index 0000000..c58da98 --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksServer.java @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package demo.jaxrs.nio; + +import org.apache.cxf.cdi.CXFCdiServlet; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.jboss.weld.environment.servlet.BeanManagerResourceBindingListener; +import org.jboss.weld.environment.servlet.Listener; + +public class BooksServer { + public static void main( final String[] args ) throws Exception { + final Server server = new Server(8282); + + // Register and map the dispatcher servlet + final ServletHolder servletHolder = new ServletHolder(new CXFCdiServlet()); + final ServletContextHandler context = new ServletContextHandler(); + context.setContextPath("/"); + context.addEventListener(new Listener()); + context.addEventListener(new BeanManagerResourceBindingListener()); + context.addServlet(servletHolder, "/rest/*"); + + server.setHandler(context); + server.start(); + server.join(); + } +} + http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/beans.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/beans.xml b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000..7e2559b --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/beans.xml @@ -0,0 +1,10 @@ + + + + + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/cxf/org.apache.cxf.Logger ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/cxf/org.apache.cxf.Logger b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/cxf/org.apache.cxf.Logger new file mode 100644 index 0000000..27dd788 --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/cxf/org.apache.cxf.Logger @@ -0,0 +1 @@ +org.apache.cxf.common.logging.Slf4jLogger \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/books.txt ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/books.txt b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/books.txt new file mode 100644 index 0000000..d830d91 --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/books.txt @@ -0,0 +1,1270 @@ +Molecular Breeding and Nutritional Aspects of Buckwheat +{Progress in Heterocyclic Chemistry, Volume 28} +Oral, Head and Neck Oncology and Reconstructive Surgery +Pharmacology and Therapeutics for Dentistry +Sedation +Clinical Reasoning in Musculoskeletal Practice +Maxillofacial Surgery +A Practical Guide to Fascial Manipulation +Case Studies in Clinical Cardiac Electrophysiology +Liu, Volpe, and Galetta’s Neuro-Ophthalmology +Plotkin's Vaccines +Hematology +Integrative Medicine +Gynecologic Pathology +Swaiman's Pediatric Neurology +Pathology of Melanocytic Tumors +Zakim and Boyer's Hepatology +Case Reviews in Ophthalmology +Essential Echocardiography +Evidence-Based Physical Diagnosis +Pulmonary Pathology +Manual for Pulmonary and Critical Care Medicine +Nelson Pediatric Symptom-Based Diagnosis +Arrhythmia Essentials +Clinical Gynecologic Oncology +Surgical Implantation of Cardiac Rhythm Devices +Atlas of Image-Guided Spinal Procedures +Goldberger's Clinical Electrocardiography +Principles and Practice of Pediatric Infectious Diseases +Kaufman's Clinical Neurology for Psychiatrists +Cardiovascular Magnetic Resonance +Practical Hepatic Pathology: A Diagnostic Approach +Drugs for Pregnant and Lactating Women +Volpe's Neurology of the Newborn +Chronic Coronary Artery Disease +Hypertension: A Companion to Braunwald's Heart Disease +Practical Pulmonary Pathology: A Diagnostic Approach +Obstetric Imaging: Expert Radiology +Diagnostic Pathology of Infectious Disease +Cardiac Electrophysiology: From Cell to Bedside +Practical Surgical Neuropathology: A Diagnostic Approach +The Interventional Cardiac Catheterization Handbook +Imaging in Pediatrics +Cardiology Secrets +Nephrology Secrets +Handbook of Liver Disease +Braddom’s Rehabilitation Care: A Clinical Handbook +Interstitial Lung Disease +Textbook of Clinical Hemodynamics +Current Management of Diabetic Retinopathy +Drug Allergy Testing +Personalized Medicine in Asthma +Urgent Care Dermatology: Symptom-Based Diagnosis +Imaging in Spine Surgery +Pediatric Cancer Genetics +Handbook of Legal Medicine +Sarcoidosis: A Specialist’s Guide +Heart Failure: Epidemiology and Research Methods +Practical Guide to Obesity Medicine +Music Therapy: Research and Evidence-Based Practice +Human Milk Composition +Skull Base Imaging +Lung Cancer: Evidence-Based Clinical Evaluation and Management +Challenging Neuropathic Pain Syndromes +PET/CT in Cancer: An Interdisciplinary Approach to Individualized Imaging +Arrhythmias in Adult Congenital Heart Disease +State-of-the-Art Treatment of Osteoarthritis: A Practical Guide +Peters' Atlas of Tropical Medicine and Parasitology +Essentials of Global Health +MacSween's Pathology of the Liver +Diagnosis and Management of Adult Congenital Heart Disease +Community Pharmacy +Aulton's Pharmaceutics +Medical Pharmacology and Therapeutics +Diagnostic Atlas of Cutaneous Mesenchymal Neoplasia +Disorders of the Rotator Cuff and Biceps Tendon +Neurocritical Care Management of the Neurosurgical Patient +Blumgart's Surgery of the Liver, Biliary Tract and Pancreas +Master Techniques in Facial Rejuvenation +The Anterior Cruciate Ligament +Clinical Orthopaedic Rehabilitation: A Team Approach +Cosmetic Facial Surgery +Operative Techniques: Spine Surgery +Operative Techniques: Hand and Wrist Surgery +Aesthetic Surgery Techniques +Principles of Gynecologic Oncology Surgery +Principles of Neurological Surgery +Operative Techniques: Knee Surgery +Total Burn Care +Lumbar Interbody Fusions +Abernathy's Surgical Secrets +Pediatric Head and Neck Masses +Scaphoid Fractures: Evidence-Based Management +Functional Neurosurgery and Neuromodulation +Pathologic Basis of Veterinary Disease Expert Consult +Rebhun's Diseases of Dairy Cattle +Equine Internal Medicine +Exotic Animal Formulary +Textbook of Veterinary Diagnostic Radiology +Small Animal Medical Differential Diagnosis +Veterinary Medicine +Soil Science Test Project +Modern Detection Techniques for Food Safety and Quality +Sweet potato processing technology +Food Biosynthesis +Food Bioconversion +Soft Chemistry in Food Fermentation +Ingredients Extraction by Physico-Chemical Methods +Why Penguins Communicate +ISTE topics in Agriculture 1 +Plant Macro-Nutrient Use Efficiency +A Practical Guide to Sensory and Consumer Evaluation +Food Processing Technology +Kent’s Technology of Cereals +New Aspects of Meat Quality +Chemical Contaminants and Residues in Food +Regulatory Impact on Food Product Development in the European Union +Lawrie´s Meat Science +Advances in Sheep Welfare +Cereal Grains +Improving the Sensory and Nutritional Quality of Fresh Meat +Proteins in Food Processing +Poultry Quality Evaluation +Food Microstructure and Its Relationship with Quality and Stability +Baking Problems Solved +Case Studies in Novel Food Processing Technologies +Gluten-Free Ancient Grains +Starch in Food +Advances in Poultry Welfare +Soft Drink and Fruit Juice Problems Solved +Advances in Cattle Welfare +Consumer Science and Strategic Marketing: Case Studies in the Wine Industry +Sensory Panel Management +Consumer Science and Strategic Marketing: Case Studies in the Traditional Food Sector +Discrimination Testing in Sensory Science +Advances in Pig Welfare +Advances in Agricultural Animal Welfare +Food Freezing and Frozen Food Storage +Recognition Systems +Cheese +Introduction to Food Toxicology +Enzymes +Egg Innovation and Strategies for Improvement +Genomics in Food Safety +The Edible Aroids +Wine Tasting +Gorilla Pathology and Health +Fruit Juices +Sustainable Management of Arthropod Pests of Tomato +The Teeth of Living Vertebrates, Volume 1 +Food Fortification in a Globalized World +Nutrition in the Prevention and Treatment of Disease +The Vitamins +The Craft and Science of Coffee +The Biology and Conservation of the Whooping Crane (Grus americana) +Phytotherapy in Aquaculture +Biofuels, Bioenergy and Food Security +Internationalizing Food and Agricultural Sciences +Vegetarian and Plant Based Diets in Health and Disease Prevention +Proteomics in Food Science +The Biology and Conservation of Cheetahs +The Norovirus +Insect Pests of Millets +Native Arbuscular Mycorrhiza for Sustainable Agriculture +New Pesticides and Soil Sensors +Water Purification +NanoBioSensors +Food Packaging +Ecology and Evolution of Cancer +Encyclopedia of Marine Mammals +Nature's Machines +Biotic Stress Resistance in Millets +Fish Diseases +Ultrasound: Advances for Food Processing and Preservation +Controlled and Modified Atmosphere for Fresh and Fresh-Cut Produce +Bifidobacterium +Yogurt in Health and Disease Prevention +Physiology of the Cladocera +Animals and Human Society +Pathology of Zoo and Wild Animals +The Competitiveness of Tropical Agriculture +High Throughput Next Generation Sequence Analysis for Food Microbiologists +Arthropod Vector: Controller of Disease Transmission (Volume 1) +Mixed-Species Groups of Animals +Agroforestry +Arthropod Vector: Controller of Disease Transmission (Volume 2) +The Future Rice Strategy for India +Conservation for the Anthropocene Ocean +Nutrition and Functional Foods for Healthy Aging +Micronutrients in Human Health +Emerging Roles of Nutraceuticals and Functional Foods in Immune Support +Enzymes in Human and Animal Nutrition +Electron Spin Resonance in Food Science +FDA Warning Letters about Food Products +Conceptual Breakthroughs in Ethology and Animal Behavior +Sexual Biology and Reproduction in Crustaceans +Examining Ecology +Nutritional and Health Aspects of Traditional and Ethnic Foods of Nordic Countries +Bioactive Polysaccharides +Unconventional Oilseeds and Oil Sources +Wafer and Waffle Processing and Manufacturing +Starch-based Materials in Food Packaging +Starches for Food Application +Applications in High Resolution Mass Spectrometry +HARPC +Forest Management and Planning +Fatty Acids +Staphylococcus Aureus +Nanoencapsulation of Food Bioactive Ingredients +The Coconut +Preharvest Modulation of Postharvest Fruit and Vegetable Quality +Ethnozoology +Hazard Analysis and Risk Based Preventative Controls +Valid Preventive Food Safety Controls +Food Irradiation +Innovative Technologies for Food Preservation +Emerging Nanotechnologies in Food Science +Practical Guide to Vegetable Oil Processing +Process Control +Retrovirus-Cell Interactions +Mucosal Vaccines +Cell Surface GRP78, a New Paradigm in Signal Transduction Biology +Immunosensing for Detection of Protein Biomarkers +Ion Channels in Health and Disease +Genetics and Evolution of Infectious Diseases +Neuropsychiatric Disorders and Epigenetics +Genomic and Precision Medicine +Translating Epigenetics to the Clinic +American Trypanosomiasis +Epigenetics and Behavior +Viroids and Plant Viral Satellites +Genomic and Precision Medicine +Neural Lipid Signalling +Developmental and Regenerative Biology +Biology and Engineering of Stem Cell Niches +Diagnostic Molecular Biology +Translational Aspects of Extracellular Matrix +Epigenetics and Systems Biology +Viruses +Nuclear Architecture and Dynamics +Regenerative Medicine Translation +Biological Chemistry +Computational Epigenomics and Disease +Cytokine Effector Functions in Tissues +PCR Guru +Long Noncoding RNAs +The Human Body +Nitric Oxide +Science Careers in Flux +Gnotobiology +Microscale Transport In Biological Processes +RNA Methodologies +The European Research Management Handbook +Protein NMR Spectroscopy +Bioprinting +Handbook of Epigenetics +Oral Communication Skills for Scientific Presentations +An Introduction to Ethical, Safety and Intellectual Property Rights Issues in Biotechnology +Progress and Challenges in Precision Medicine +Electrocardiography of Laboratory Animals +Dyneins +Dyneins +Epigenetic Mechanisms in Cancer +Problem Sets Series: Case Studies in Biochemistry +Polycomb Group Proteins +Glyceraldehyde-3-Phosphate Dehydrogenase (GAPDH) +HIV/AIDS +Bioinformatics for Beginners +Gas Bubble Dynamics in the Human Body +Cancer and Noncoding RNAs +High Throughput Formulation Development of Biopharmaceuticals +Nanoemulsions +Early Warning for Infectious Disease Outbreak: Theory and Practice +International Gender Specific Medicine +Congenital Adrenal Hyperplasia +ISTE topics in Biomedical Science 1 +ISTE topics in Biomedical Science 2 +Data Literacy +Atlas of Comparative Vertebrate Histology +Laboratory Exercises in Molecular Pathology +An Introduction to Cardiovascular Therapy +Kidney Transplantation, Bioengineering and Regeneration +Back to Basics In Physiology +The Contribution of Pathology and Laboratory Medicine to Clinical Informatics +Advances in Brain Cancer for Clinicians and Scientists +Molecular Pathology +Biomarkers in Inborn Errors of Metabolism +Comparative Anatomy and Histology +Think Like a Biostatistics Analyst +Clinical Informatics Literacy +Textbook of Nephro-Endocrinology +The Heart in Rheumatologic, Inflammatory and Autoimmune Diseases +Endocrine Biomarkers +Principles of Gender-Specific Medicine +Handbook of Supportive and Palliative Radiation Oncology +Translational Advances in Gynecologic Cancers +Lung Epithelial Biology in the Pathogenesis of Pulmonary Disease +Ethical Challenges in Oncology +Alpha-1-antitrypsin Deficiency +Transfusion Medicine, Apheresis, and Hemostasis +Cutaneous Melanoma +Introduction to Cancer Metastasis +The Microbiota in Gastrointestinal Pathophysiology +Bone Marrow Failure +The Pituitary +Genetics of Bone Biology and Skeletal Disease +Case Studies in Physiology +Liver Pathophysiology +Chronic Kidney Disease in Disadvantaged Populations +Translational Bioinformatics and Systems Biology Methods for Personalized Medicine +Cushing's Disease +Case Studies in Public Health +Global Health Informatics +Omics Technologies and Bio-engineering +Research in the Biomedical Sciences +Dietary Fiber for the Prevention of Cardiovascular Disease +eHealth +Microbiology and Molecular Diagnosis in Pathology +Health Professionals' Education in the Age of Clinical Information Systems, Mobile Computing and Social Networks +Gastrointestinal Tissue +Alcohol, Drugs, Genes and the Clinical Laboratory +Nitric Oxide Donors +Disaster Epidemiology +Pouchitis and Ileal Pouch Disorders +Atlas of the Human Body +Human Genome Informatics +Key advances in clinical informatics +Blanco's Overview of Alpha-1 Antitrypsin Deficiency +Interesting Cases in Pulmonary Medicine +Molecular Physiology of the Blood Vessel +Health Reform Policy to Practice +GERD: A NEW UNDERSTANDING OF PATHOLOGY, PATHOPHYSIOLOGY, AND TREATMENT +Manual of Chronic Total Occlusion Interventions +Bladder Cancer +Vitamin D +Vitamin D +Medical Writing and Editing +Preventive Medicine +The Complete Reference for Scimitar Syndrome +Skin Tissue Models for Regenerative Medicine +Nitric Oxide as a Chemosensitizing Agent +Wilson Disease +Anticancer Drugs: Navelbine® and Taxotère® +Biopharmaceutical Management +Pharmacoepidemiology and Pharmacovigilance +Signals and Systems in e-Health +New Health Systems +Statistical Mechanics of Colloidal Matter +ESCAPE 27 Set +Coalescence Separations +Handbook of Spent Hydroprocessing Catalysts +Reliability, Maintainability and Risk 9E +Recrystallization and Related Annealing Phenomena +Handbook of Bioprocessing +Solid Fuels and Heavy Hydrocarbon Liquids +Theory of Electrophoresis and Diffusiophoresis of Highly Charged Colloidal Particles +Bretherick's Handbook of Reactive Chemical Hazards +Coulson and Richardson’s Chemical Engineering +Coulson and Richardson’s Chemical Engineering +Coulson and Richardson’s Chemical Engineering +Coulson and Richardson’s Chemical Engineering +Coulson and Richardson’s Chemical Engineering +Process Safety Calculations +Chemical Reaction Engineering +The Science and Technology of Unconventional Oils +Materials Under Extreme Conditions +Recent Advances in Emerging Membrane Science and Technology +Thermodynamics, Phase Diagrams and Thermodynamic Modeling of Solutions +Cosmetic Science and Technology: Theoretical Principles and Applications +Novel Catalytic and Separation Processes Based on Ionic Liquids +Technologies for Biochemical Conversion of Biomass +Process Plant Layout, 2e +Natech Risk Assessment and Management +Polyurethane Polymers +Polyurethane Polymers +Lignocellulosics +Advanced and Emerging Polybenzoxazine Science and Technology +Concise Encyclopaedia of Combustion Synthesis +A Systems Approach to Managing the Complexities of Process Industries +The Art of Cryogenics +Morphological, Compositional, and Shape Control of Materials for Catalysis +Low Grade Heat Driven Multi-Effect Distillation +Solar Energy Desalination Technology +Desalination Sustainability +Sustainable Design Through Process Integration +General Chemistry for Engineers +Pulp and paper Industry +Pulp and Paper Industry +Reaction Rate Theory and Rare Events Simulations +Lead-Acid Batteries: Science and Technology +Artificial Photosynthesis +Monodispersed Particles +Advanced Industrial Lead-Acid Batteries +Pressurized Fluids for Food and Natural Products Processing +New and Future Developments in Microbial Biotechnology and Bioengineering +New and Future Developments in Microbial Biotechnology and Bioengineering +New and Future Developments in Microbial Biotechnology and Bioengineering +Life-Cycle Assessment of Biorefineries +Modern Inorganic Synthetic Chemistry +Lead-Acid Batteries for Future Automobiles +Nanolayer Research +Future Directions in Biocatalysis +Membrane Characterization +Safety of Lithium Batteries +Experimental Methods and Instrumentation for Chemical Engineers +Algal Green Chemistry +Non-covalen Interactions in Organocatalysis +Bioreactor Modeling +Organocatalyzed Domino and Multicomponent Reactions +Recent Advances in Aminocatalyzed Cascade Reactions +SOMO and Photoredox Activations in Asymmetric Organocatalysis +Separation Science and Technology +Transition Metal Catalyzed Isoquinoline Synthesis +Fundamentals of Enviromental Chemistry +Searching and Researching: An Autobiography +Frontiers and Advances in Molecular Spectroscopy +Biological Chirality +The Evolution of Medicinal Chemistry +Validamycin and its Derivatives +Design of Hybrid Molecules for Drug Development +The Chemistry of Heterocycles +Multi-Scale Approaches in Drug Discovery +Medicinal Chemistry for Organic Chemists +Electron Microscopy and Analysis +Organosilicon Compounds +Advanced Inorganic Chemistry +Sampling and Analysis of Environmental Chemical Pollutants +Future Role of Chemistry as Gleaned from Granted U.S. Chemical Patents +Metal Complexes of Non-Innocent Ligands +Patent Law Basics for Chemists and Research Professionals +Selection of the HPLC Method in Chemical Analysis +C-Furanosides +Modern Synthesis Processes and Reactivity of Fluorinated Compounds +Inorganic and Organometallic Transition Metal Complexes +Encapsulated Catalysts +Modelling and Simulation in the Science of Micro- and Meso-Porous Materials +Piperidine-based Drug Design +Strategies for Palladium-Catalyzed Non-Directed and Directed C-H Bond Functionalization +Liquid Chromatography +Liquid Chromatography +Separation Science and Proteomics +Supercritical Fluid Chromatography +Transition Metal-Catalyzed Benzofuran Synthesis +Transition Metal-Catalyzed Pyrimidine Synthesis +Water Extraction of Bioactive Compounds +Discovery and Development of Antidiabetic Agents From Natural Products +Handbook of Synthetic Organic Chemistry +Making Fragments From Drugs +Non-covalent Interactions in Quantum Chemistry and Physics +Electrons, Atoms, and Molecules in Inorganic Chemistry +Sample Introduction Systems in ICP-MS and ICP-OES +Priority Pollutants Monitoring in Water +Frontiers in Medicinal Chemistry +Big Data and Smart Service Systems +Data Fusion for Intelligent Vehicles +Lossless Information Hiding in Images +Big Data in Cyber-Physical Society +Machine Learning +OpenACC Programming +Three-dimensional Integrated Circuit Design +FTTX Networks +Network Routing +Contextual Design +Understanding Virtual Reality +Patterns for Data Parallel Programming +Mobile Sensors and Context-Aware Computing +Environment Modeling-based Requirements Engineering for Software Intensive Systems +Penetration Tester's Open Source Toolkit +Rugged Embedded Systems +CUDA Programming +Silicon Photonics +Transfer Learning +Usability Testing for Survey Research +Advances in GPU Research and Practice +Cognitive Information Systems in Management Sciences +Computer and Information Security Handbook +Network Storage +Application Management for Mobile and Cloud Systems +Embedded Computing for High Performance +Securing the Internet of Things +Aging-Friendly Design +Software Defined Networks +Adaptive Mobile Computing +Hacking Wireless Access Points +Peering Carrier Ethernet Networks +Research Methods for Cyber Security +OCEB 2 Certification Guide +Research Methods in Human Computer Interaction +Software Architecture for Cloud and Big Data +Coding for Penetration Testers +TopUML Modeling +Knowledge Science +Advanced Persistent Security +Big Data Analytics for Sensor-Network Collected Intelligence +Mobile Cloud Computing +Federal Cloud Computing +Managing the Web of Things +Smart Sensors Networks +Deep Learning for Medical Image Analysis +Statistical Shape and Deformation Analysis +Wireless Public Safety Networks 3 +Certifiable Software Applications 3 +Certifiable Software Applications 4 +ESD Protection Methodologies +Flash Memory Integration +B Method +Marine Geo-Hazards in China +Earth's Oldest Rocks +ISTE topics in Earth and Planetary Science 1 +ISTE topics in Earth and Planetary Science 2 +ISTE topics in Earth and Planetary Science 3 +Infrared and Raman Spectroscopy of the Cationic Clay Minerals +Uncertainty Analysis in Earth and Environmental Science +Ore Dogs and Economic Geology +Progress in Rock Physics +Thermodynamics of Atmospheres and Oceans +Terrestrial Depositional Systems +Statistical Modeling and Analysis +Practical Petroleum Geochemistry for Exploration and Production +Economic Minerals +Integrating Emergency Management and Disaster Behavioral Health and Science +Theory of Electromagnetic Well Logging +Nickel Sulfide Ores and Impact Melts +Risk Modeling for Hazards and Disasters +Volatiles in the Martian Crust +Urban Planning for Disaster Recovery +Proterozoic Orogens of India +Data Assimilation for the Geosciences +How to Become a International Disaster Volunteer +Handbook of Mineral Spectroscopy, Volume 1 +KAPPA DISTRIBUTIONS +Social Network Analysis of Disaster Response, Recovery, and Adaptation +Practical Solutions to Integrated Reservoir Analysis +The Indian Ocean Nodule Field +Introduction to Satellite Remote Sensing +Permo-Triassic Salt Provinces of Europe, North Africa and Central Atlantic +Geographical Information Management in Polar Regions +Case Studies in Disaster Preparedness +Case Studies in Disaster Mitigation +Creating Katrina, Rebuilding Resilience +Shale Gas +Map Interpretation for Structural Geologists +Coding and Decoding: Seismic Data +Processes and Ore Deposits of Ultramafic-Mafic Magmas through Space and Time +The Quaternary Ice Age in the Alps +Practical Prospect Evaluation +Interpretation of Micromorphological Features of Soils and Regoliths +Introduction to Volcanic Seismology +Data Room Management and Rapid Asset Evaluation - Theory and Case Studies in Oil and Gas +Isotopic Geochemistry and Paleobiology +Palaeobiology of Extinct Giant Flightless Birds +Marine Reptiles Adaptation to Aquatic Life +Evolutionary History of Freshwater Fishes during the Last 200 Millions Years +Evolution of Dental Tissues and Paleobiology in Selachians +Cenozoic Mammals and their Evolutionary Context +Fossil Turtles of China +Thermal Recovery of Oil and Bitumen +Fine and ultrafine coal processing +Clean Coal Engineering Technology +Carbon Capture and Storage +Heat Recovery Steam Generator Technology +Advanced Light Water Reactor Fuel Technology +Materials and Water Chemistry for Supercritical Water-cooled Reactors +Big Data Application in Power Systems +Specifications of Photovoltaic Pumping Systems in Agriculture +Design of Transient Protection Systems +Managed Pressure Drilling +Deepwater Drilling +POWER ELECTRONICS HANDBOOK +ISTE topics in Energy 1 +ISTE topics in Energy 2 +ISTE topics in Energy 3 +ISTE topics in Energy 4 +Underground Coal Gasification and Combustion +Gas, Fire and Respirable Dust control In Underground Coal Mines +Renewable Energy Forecasting +Geological Repository Systems for Safe Disposal of Spent Nuclear Fuels and Radioactive Waste +Thermal Hydraulics in Nuclear Reactors +Hydrogen and Fuel Cells +Supercritical Carbon Dioxide (SCO2) Based Power Cycles +Steam Generators for Nuclear Power Plants +Low-rank Coals for Power Generation, Fuel and Chemical Production +Coal Combustion Products (CCP's) +Microalgae-Based Biofuels and Bioproducts +Bioenergy Systems for the Future +Greenhouse Gases Balance of Bioenergy Systems +Optimization in Renewable Energy Systems +Nuclear Power +Electricity Generation & The Environment +Non-Destructive Testing and Condition Monitoring Techniques for Renewable Energy Industrial Assets +Solid Oxide Fuel Cell Lifetime and Reliability +Large Scale Biomass Combustion Plants +Trends in Oil and Gas Corrosion Research and Technologies +Power Systems Analysis +Electrical Power Systems +Molten Salt Reactors and Thorium Energy +Advances in Productive, Safe, and Responsible Coal Mining +Offshore Electrical Engineering Manual +Fuel Cell Propulsion +Electric Vehicles: Prospects and Challenges +Deep Shale Oil and Gas +Fluid Phase Behavior for Conventional and Unconventional Oil and Gas Reservoirs +Distributed Generation Systems +Steam Generation from Biomass +Advances in Sugarcane Biorefinery +Introduction to Petroleum Biotechnology +UHV Transmission Technology +Control of Power Electronic Converters and Systems +The Power Grid +High Temperature Thermal Storage Systems using Phase Change Materials +Thermal Energy Storage Analyses and Designs +Clean Energy for Sustainable Development +Petroleum Production Engineering +Torrefaction of Biomass for Energy Applications +PEM Fuel Cell Modelling and Simulation using MATLAB +Theoretical and Applied Aspects of Biomass Torrefaction +Renewable Energy Integration +Handbook of Biotechnology-Based Alternative Fuels +European energy markets and society +Practical Handbook of Photovoltaics +Integrated Energy Systems for Multigeneration +Energy Positive Neighborhoods and Smart Energy Districts +Performance Management for the Oil, Gas, and Process Industries +One-dimensional nanostructures for PEM fuel cell applications +Hydrogen Economy +PEM Water Electrolysis +Unconventional Oil and Gas Resource Engineering +Transmission lines inspection and monitoring technology of remote sensing +Space Microsystems and Micro/Nano Satellites +Onshore Structural Design Calculations +Construction Delays +Modelling, Solving and Application for Topology Optimization of Continuum Structures --- ICM Method Based on Step Function +Biot's Poroelastic Theory in Engineering +Transient Electromagnetic-Thermal Nondestructive Testing +Permeability Properties of Plastics and Elastomers +Repair and Rehabilitation of Structures +Linux for Embedded and Real-time Applications +Thermo-Mechanical Modeling of Additive Manufacturing +Green Building Energy Simulation and Modeling +Intelligent fault diagnosis and remaining useful life prediction of rotating machinery +Cyber-Physical Systems in Production Engineering +Databook of Blowing and Auxiliary Agents +Nonlinear systems in Heat transfer +Handbook of Foaming and Blowing Agents +Atlas of Material Damage +Handbook of Plasticizers +Handbook of Odors in Plastic Materials +Databook of Plasticizers +Tribology Testing +Academic Press Library in Signal Processing Volume 6 +Reliability Based Airframe Maintenance Optimization and Applications +Academic Press Library in Signal Processing Volume 7 +Healthcare Technology Management Systems +Embedded Mechatronic Systems 1 - 2nd Edition +Embedded Mechatronic Systems 2 - 2nd Edition +Durability and Reliability of Photovoltaic Polymers and Other Materials +Global Engineering Ethics +Optimization Tools for Logistics – 2nd ed / V1 – Theory and Fundamentals +Optimization Tools for Logistics – 2nd ed / V2 – Software applications +ISTE topics in Engineering 1 +ISTE topics in Engineering 2 +ISTE topics in Engineering 3 +ISTE topics in Engineering 4 +ISTE topics in Engineering 5 +ISTE topics in Engineering 6 +ISTE topics in Engineering 7 +ISTE topics in Engineering 8 +ISTE topics in Engineering 9 +ISTE topics in Engineering 10 +ISTE topics in Engineering 11 +ISTE topics in Engineering 12 +ISTE topics in Engineering 13 +Dynamic Analysis of High-Speed Railway Alignment +Principles of Railway Location and Design +Thermal Analysis in Practice +Basic Polymer Engineering Data +Extrusion Dies for Plastics and Rubber +Understanding Polymer Processing +High Voltage Engineering Fundamentals +Mechanical Testing of Orthopaedic Implants +Geometry for Naval Architects +Marine Propellers and Propulsion +Aircraft Sustainment and Repair +TV White Space Communications and Networks +Strengthening of Concrete Structures Using Fiber Reinforced Polymers (FRP) +Principles of Textile Finishing +Spacecraft Dynamics and Control +Plastics Engineering +Civil Aircraft Electrical Power System Safety Assessment +Lea's Chemistry of Cement and Concrete +Porous Rock Failure Mechanics +Art of the Helicopter +High-Performance Apparel +Manikins for Textile Evaluation +Computational Methods for Fracture in Porous Media +Power Supplies for LED Driving +Morphing Wings Technologies +Demystifying Numerical Models +Boiling +Thermal Power Plant +Air Conditioning Systems Design +Cost-effective Energy Efficient Building Retrofitting +Advances in Carpet Manufacture +Automation in Garment Manufacturing +Applications of Computer Vision in Fashion and Textiles +Skeletonization +Microgrid +The Circuit Designer's Companion +Instrumental Seismology Manual +Space Safety and Human Performance +Unsteady Flow and Aeroelasticity in Turbomachinery +Atomistic Simulation Methods in Solid Mechanics +Aeroacoustics: Fundamentals and Applications in Aeropropulsion Systems +Design and Analysis of Intelligent Tires +Software Defined and Mixed Signal Radio Characterization: Theory, Methods and Applications for Emerging Wireless Systems +Embedded Operating systems and Board Support Packages +Gas Explosion Handbook +Computational Visual Perception for Image and Video Processing +Analysis and Design of Curved Girder Bridges +Microelectronics for the Internet of Things +Analysis and Design of Integral Abutment Bridges +Opto-Mechanical Fiber Optic Sensors +Navigation with Signals and Constraints of Opportunity +Underground Sensing +Biomedical Engineering in Gastrointestinal Surgery +Deep Learning in Computer Vision +General Aviation Aircraft Load Analysis +Introduction to Nature-Inspired Optimization +Cooperative Control and Sensing for Mobile Sensor Networks +Bioinspired Legged Locomotion +Nano and Bio Heat Transfer and Fluid Flow +Chemical Engineering Process Simulation +Biofluid Mechanics of the Respiratory System +Biomechanics of Living Organs +Safety Analysis for LNG Facilities +Wheeled Mobile Robotics +Rockbolting +Bridge Engineering +Oil Spill Environmental Forensics Case Studies +Advanced Gear Manufacturing and Finishing +Humanoid Robots +Renewable Energy +Trauma Plating Systems +THE FPGA Users Guide +Strut and Tie Models +Atherosclerotic Plaque Characterization Methods based on Coronary Imaging +Fundamentals of Geoenvironmental Engineering +Personalized Predictive Modelling in Diabetes +Rockburst +Assurance of Sterility for Sensitive Combination Products and Materials +Soil Fracture Mechanics +Indoor Navigation Strategies for Aerial Autonomous Systems +Differential Transformation Method for Mechanical Engineering Problems +Ambient Assisted Living and Enhanced Living Environments +Subsea Valves Handbook +Wastes and Wastewater Treatment in the Petroleum Industry +Mechanics of Flow-Induced Sound and Vibration V1 +Mechanics of Flow-Induced Sound and Vibration V2 +Group and Crowd Behavior for computer Vision +More Best Practices for Rotating Equipment +Computer and Machine Vision +Transportation Highway Engineering Calculations and Rules of Thumb +Software Engineering for Embedded Systems +Thermal System Design and Simulation +High Dynamic Range Video +iMprove +Irregular Shape Anchor in Cohesionless Soils +Polyaniline Blends, Composites, and Nanocomposites +Soil Reinforcement for Anchor Plates +Forsthoffer's Component Condition Monitoring (CCM) Handbook +The Aeroacoustics of Low Mach Number Flows +Satellite Signal Propagation, Impairments and Mitigation +Solid and Hazardous Waste Management +Heat Transfer in Aerospace Applications +Basic Finite Element Method as Applied to Injury Biomechanics +Guide to Laser Welding +Surface Production Operations: Volume IV: Pump and Compressor Systems: Mechanical Design and Specification +Embedded and IoT Software Development +Manufacturing Optimization Using the Internet of Things +Time-Critical Cooperative Control of Autonomous Air Vehicles +General Aviation Aircraft Design +Orthogonal Waveforms and Filter Banks for Future Communication Systems +Industrial Water Treatment Process Technology +Understanding Automotive Electronics +Mechanical Circulatory and Respiratory Support +Discrete-Time Neural Observers +Computing and Visualization for Intravascular Imaging and Computer Assisted Stenting +Mechanics of Carbon Nanotubes +Rigid Body Dynamics for Space Applications +eMaintenance +Plastics in Medical Devices for Cardiovascular Applications +Sittig's Handbook of Toxic and Hazardous Chemicals and Carcinogens +Designing Successful Products with Plastics +Fluoropolymer Applications in Chemical Processing Industries +Applications of Plastics Under-the-hood in Automotives +Plasticizers Derived from Post-consumer PET +Advanced Machining Processes of Metallic Materials +Computational Methods and Production Engineering +Microfabrication and Precision Engineering +Engineering Bioplastics +Plastics Handbook +Moldflow Design Guide +Combination Technologies on the Basis of Injection Molding +Structure and Rheology of Molten Polymers +Molding Simulation: Theory and Practice +Nontraditional Fillers and Stiffening Agents for Polymers +10 Fundamental Rules for Design of Plastic Products +Processing of Nanocomposite Polymers +Leadership & Management of Machining +Discrete Mechanics of Capillary Bridges +Inside the Structure of Granular Materials +THID, the Ultimate Outcome of RFID +Robustness in Electro-thermal Phenomena +RCS Synthesis for Chipless RFID +Reliability Investigation of Leds Devices for Public Light Applications +Reliability Investigation on Laser Diode Coupling Electro-Optical Models and Physics of Failure +Reliability of Photonics Devices +Systems Architecture Modeling with the Arcadia Method +Model-based System and Architecture Engineering +SysML in Action with Papyrus +SysML in Action with Cameo Systems Modeler +Fractal and Trans-Scale Nature of Entropy +From Pinch Methodology to Energy Integration of Flexible Systems +Fractal and Trans-Scale Nature of Entropy / Towards a geometrization of thermodynamics +Coastal Wetlands +Initial Human Colonization of Arctic in Changing Paleoenvironments +Time and Methods in Environmental Interfaces Modelling +Nanoparticles in the Environment: A Contradictory Relationship with Plants, Algae and Microorganisms +Nanoparticles in the Environment: A Contradictory Relationship with Plants, Algae and Microorganisms +ISTE topics in Environmental Science 1 +ISTE topics in Environmental Science 2 +ISTE topics in Environmental Science 3 +Thorp and Covich's Freshwater Invertebrates +Physical Limnology +Methods in Stream Ecology +Chemical Ecology +Periphyton +The Transition to Modern Earth +Atmospheric Impacts of the Oil and Gas Industry +Intermittent Rivers +Water for the Environment +Wetland and Stream Rapid Assessments +Maintaining Land Productivity +Soil Mapping and Process Modeling for Sustainable Land Use Management +Fundamentals of Soil Ecology +The Application of Green Solvents in Separation Processes +Soil Magnetism +Tropical Extremes: Natural Variability and Trends +The Political Ecology of Oil & Gas Activities in the Nigerian Aquatic Ecosystem +The Ecology of Sandy Shores +Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS +Assessment, Restoration and Reclamation of Mining Influenced Soils +Remote Sensing of Aerosols, Clouds, and Precipitation +Decision Making in Water Resources Policy and Management +A New Ecology +Environmental Geochemistry +Biodiversity and Health +Cybernomics +The Fair Return +The Economics of Education +Handbook of Investor Behavior during Financial Crises +ISTE topics in Finance +Decision-Making +China Business Model: Originality and Limits after the Slowdown of 2013 +The Wine Value Chain in China +Handbook of the Chinese Economy and Its External Economic Relations +Underwriting Services and the New Issues Market +Introduction to Agent-Based Economics +Entrepreneurship and the Finance of Innovation in Emerging Markets +International Money and Finance +Smart Specialization Theory and Practice +Redefining Capitalism in Global Economic Development +Strategic Financial Management Casebook +Advanced Macroeconomics: An Alternative Approach +Principles of Project Finance +Handbook of Digital Banking and Internet Finance +Probability, Statistics and Econometrics +Equilibrium Problems and Applications +Engineering Investment Process +Portfolio Diversification +Investigating Windows Systems +Deception In Digital Age +Physical Criminalistics +Forensic Investigations +Global Supply Chain Security and Management +False Allegations +Inside Forensic Reform +Digital Forensics Trial Graphics +Security Operations Center Guidebook +An Atlas of Skeletal Trauma in Medico-Legal Contexts +Security Metrics Management +Effective Physical Security +Human Remains - Another Dimension +The Manager's Handbook for Corporate Security +The Five Technological Forces Disrupting Security +Sports Team Security +Creating Digital Faces for Law Enforcement +From Corporate Security to Commercial Force +Contemporary Digital Forensic Investigations of Cloud and Mobile Applications +Urban Emergency Management +Contemporary Security Management +The Psychology of Criminal and Antisocial Behavior +Cell Phone Location Evidence for Legal Profesionals +Integrating Python with Leading Computer Forensics Platforms +Ambulatory Surgery Center Safety Guidebook +Viral Diseases of Africa and Global Public Health +Microbial Glycobiology +Viral Collectives +Advances in Microbiology +The Skin in Systemic Autoimmune Diseases +Surgery in Systemic Autoimmune Diseases in the Era of Biological Agents +Vaccinology in Latin America +The history of Immunology +Zika Virus +Controversies in Vaccine Safety +Future Directions in Water and Wastewater Microbiology +Adjuvants and Autoimmunity +The Heart in Systemic Autoimmune Diseases +Immunopotentiators in Modern Vaccines +The Innate Immune System: A compositional and functional perspective +Microbial Resources +Autophagy: Cancer, Other Pathologies, Inflammation, Immunity, Infection, and Aging +Ticks of Trinidad and Tobago - An Overview +THE COMPLEMENT FACTSBOOK, 2ND EDITION +Antimicrobial Stewardship (AMS) +Ticks of the Southern Cone of America +Antiphospholipid Syndrome in Systemic Autoimmune Diseases +The Digestive Involvement in Systemic Autoimmune Diseases +Carbon for Electronic and Energy Applications +Graphite and Carbon Materials In Nuclear Engineering +Advanced Polyimide Materials +Customized All-Ceramic Dental Prostheses +Algae Based Polymers, Blends, and Composites +Emerging Nanotechnologies in Dentistry +Defect Structure in Nanomaterials +ISTE topics in Materials Science 7 +ISTE topics in Materials Science 1 +ISTE topics in Materials Science 2 +ISTE topics in Materials Science 3 +ISTE topics in Materials Science 4 +ISTE topics in Materials Science 5 +Engineering with Magnesium: Science, Technology and Application +Light Alloys +Nanofiber Composite Materials for Biomedical Applications +Steels: Microstructure and Properties +Stability and Vibrations of Thin Walled Composite Structures +Advanced Characterization and Testing of Textiles +Biomechanics of Tendons and Ligaments +Functionalised Cardiovascular Stents +Hemocompatibility of Biomaterials for Clinical Applications +Thermal Analysis of Textiles and Fibers +Fibrous Filter Media +A Clinical Guide to Fibre Reinforced Composites FRCs in Dentistry +Natural Fibre-reinforced Biodegradable and Bioresorbable Polymer Composites +Principles for Evaluating Building Materials in Sustainable Construction +Nanobiomaterials +3D Printing in Medicine +Peptide Applications in Biomedicine, Biotechnology and Bioengineering +Characterization of Polymeric Biomaterials +Biomedical Composites +Green Composites +Hybrid Polymer Composite Materials +Hybrid Polymer Composite Materials +Hybrid Polymer Composite Materials +Hybrid Polymer Composite Materials +Biocomposites for High-Performance Applications +Self-assembling Beta-sheet Forming Peptide Biomaterials +Peptides and Proteins as Biomaterials for Tissue Regeneration and Repair +Advances in Ceramic Biomaterials +Dynamic Response and Failure of Composite Materials and Structures +Tribology: Friction and Wear of Engineering Materials +Bioactive Glasses +Cellulose-reinforced Nanofibre Composites +Materials Selection for Natural Fiber Composites +Lignocellulosic Fibre and Biomass-based Composite Materials +Nanobiomaterials Science, Development and Evaluation +Biodegradable and Biocompatible Polymer Composites +Functional 3-D Tissue Engineering Scaffolds +Performance of Bio-based Building Materials +Sustainable Construction Materials +Sustainable Construction Materials +Sustainable Construction Materials +Fundamentals of nanotechnology in Biomaterials +Electrospun Materials for Tissue Engineering and Biomedical Applications +Foundations in Biomaterials Engineering +Nanocrystals for Laser-induced Solid State Lighting +Polyolefin Fibers +Waterproof and Water Repellent Textiles and Clothing +Principles and Applications of Organic Light Emitting Diodes (OLEDs) +Nanofinishing of Textile Materials +Advances in Laser Materials Processing +Advanced Piezoelectric Materials +Iron oxide nanoparticles for biomedical applications +Colour Design +Crazing technology for polyester fibers +Engineering of high-performance textiles +Natural dyes for textiles +Transition Metal Oxide Thin Film based Chromogenics and Devices +Fiber Technology for Fiber-reinforced Composites +Forensic Textile Science +Composite Materials +Laser Surface Engineering of Aluminum Alloys +Handbook of Solid State Diffusion: Diffusion Fundamentals and Techniques +Handbook of Solid State Diffusion: Volume 2 +High Temperature Coatings +Functional Glasses and Glass-Ceramics +Microstructural Characterization of Radiation Effects in Nuclear Materials +Laser Shock Peening of Advanced Ceramics +Ni-free Ti-based Shape Memory Alloys +Crystallization in Multiphase Polymer Systems +Biomaterials +Seaweed Polysaccharides +Metal Oxides in Energy Technologies +Metal Oxide-Based Thin Film Structures +The Future of Semiconductor Oxides in Next-Generation Solar Cells +Biopolymer Grafting: Applications +Metal Oxides in Supercapacitors +A Teaching Essay on Residual Stresses and Eigenstrains +Functionalized Nanomaterials for the Management of Microbial Infection +Emerging Nanotechnologies in Rechargable Energy Storage Systems +Heat Transport in Micro and Nanoscale Thin Films +Microbiorobotics +Nanodiamonds +Mechanical Behaviours of Carbon Nanotubes +Developments in Surface Contamination and Cleaning: Methods for Surface Cleaning +Nano Optoelectronic Sensors and Devices +Thermoelectricity and Heat Transport in Graphene and other 2D Nanomaterials +Metal Semiconductor Core-shell Nanostructures for Energy and Environmental Applications +Nanomaterials for Biosensors +Thermal and Rheological Measurement Techniques for Nanomaterials Characterization +Spectroscopic Methods for Nanomaterials Characterization +Microsopy Methods in Nanomaterials Characterization +Nanostructures for Novel Therapy +Nanostructures for Drug Delivery +Nanostructures for Cancer Therapy +Nanostructures for Antimicrobial Therapy +Clay-Polymer Nanocomposites +Nanotechnology for Microelectronics and Optoelectronics +Thermal Transport in Carbon-Based Nanomaterials +Nanostructures for Oral Medicine +Carbon Nanomaterials for Biological and Medical Applications +Nanopapers +Graphene and Related Nanomaterials +Biopolymer Grafting: Synthesis and Properties +Service Life Prediction of Polymers and Plastics Exposed to Outdoor Weathering +Nanocharacterization Techniques +Nanoscience and its Applications +Structure-mediated Nanobiophotonics +Intermetallic Matrix Composites +Nanoinformatics: Principles and Practice +Nanotechnology and Orthopaedic Surgery +Quantum Confined Lasers +Plasma Etching For CMOS Devices Realization +ISTE topics in Mathematics 1 +ISTE topics in Mathematics 2 +ISTE topics in Mathematics 3 +Techniques of Functional Analysis for Differential and Integral Equations +Topics in Mathematics 1 +Topics in Mathematics 2 +Hybrid Censoring: Models, Methods and Applications +The Material Point Method +Handbook of Statistical Analysis and Data Mining Applications +Maximum Principles for the Hill's Equation +Fractional Calculus and Fractional Processes with Applications to Financial Economics +Riemannian Submersions, Riemannian Maps in Hermitian Geometry, and their Applications +Principles of Mathematical Modeling +Inference for Heavy-Tailed Data Analysis +Differential Equations with Mathematica +A Concrete Approach to Abstract Algebra +Optimal Sports Math & Statistics +Random Operator Theory +Analysis of Step-Stress Models +Engineering Mathematics with Examples +Inequalities and Extremal Problems in Probability and Statistics +Mathematics Applied to Engineering +Existence theory of generalized Newtonian Fluids +Symbolic-Numerical Analysis of 2D Composites and Porous Material +Cryptographic Boolean Functions and Applications +Uncertainty Principle for Time Series +Handbook of Categorization in Cognitive Science +Innovative Neuromodulation +Handbook of Cannabis and Related Pathologies +DNA Modifications in the Brain +Huntington’s Disease +Mathematics for Neuroscientists +Neuroendocrinology and Endocrinology +Molecular and Cellular Therapies for Motor Neuron Diseases +Translational Immunotherapy of Brain Tumors +Evolutionary Neuropsychology +Primer on Cerebrovascular Diseases +Network Functions and Plasticity +Neuroprotection in Alzheimer's Disease +Machine Dreaming and Consciousness +Adenosine Receptors in Neurodegenerative Diseases +Rhythmic Stimulation Procedures in Neuromodulation +The Neuroscience of Cocaine +Parkinson's Disease +Rewiring the Brain +Nanotechnology Drug Delivery Techniques for Neurological Diseases and Brain Tumors +The Neurobiology of Brain and Behavioral Development +Handbook of Neuroemergency Clinical Trials +Models of Seizures and Epilepsy +Sleep and Neurologic Disease +The Human Sciences after the Decade of the Brain +Chordomas and Chondrosarcomas of the Skull Base and Spine +Neurobiology of microRNAs +Fragile X Syndrome +Biometals in Neurodegenerative Diseases +Neuroepidemiology in Tropical Health +The Complex Connection between Cannabis and Schizophrenia +Noradrenergic Signaling and Astroglia +Physical Activity and the Aging Brain +Therapeutic Targets in Neurodegenerative Disorders +Nutritional Modulators of Pain in the Aging Population +Stress and Epigenetics in Suicide +Nutrition and Lifestyle in Neurological Autoimmune Diseases +Essentials of Neuroanesthesia +Choroidal Disorders +Neuromodulation 2V set +Addictive Substances and Neurological Disease +Neuronal Correlates of Empathy +Hearing Loss +Changing Brain Activity: Improving Intelligence? +The Endocannabinoid System +Computational Psychiatry +Arachnoid Cysts +Neuroscience Basics +Designing EEG Experiments for Studying the Brain +Neurogenetics +Critical Care Neurology Part II +Critical Care Neurology Part I +The Parietal Lobe +Wilson Disease +Cavernous Malformations +Arteriovenous Malformations +Analytical Assessment of e-Cigarettes +Social and Administrative Aspects of Pharmacy in Developing Countries +FDA Quality Standards for Generic Drug Products +The Discovery and Development of Artemisinins and Derivatives as Antimalarial Agents +Advances in Molecular Toxicology +Advances in Nanomedicine for the Delivery of Therapeutic Nucleic Acids +Clinical Research in Paediatric Psychopharmacology +Free Radical Toxicology +Handbook of Bioenvironmental Reproductive Toxicology and Men’s Health +Pharmaceutical Medicine and Translational Clinical Research +Developing Solid Oral Dosage Forms +Accelerated Stability Assessment Program (ASAP) +Electronic Waste +Microsized and Nanosized Carriers for Nonsteroidal Anti-Inflammatory Drugs +Reproductive and Developmental Toxicology +In Vitro Toxicology +How to Properly Optimize a Fluid Bed Granulation Unit Operation +A Comprehensive and Practical Guide to Clinical Trials +Toxicology: What Everyone Should Know +Adverse Effects of Engineered Nanomaterials +Mutagenicity: Assays and Applications +Medicinal Spices and Vegetables from Africa +International Regulation of Biologicals +Japanese Kampo Medicines for the Treatment of Inflammatory Disease +Adverse Events of Oncotargeted Kinases +Validation of a Parenteral Solution Product +History of Risk Assessment in Toxicology +Toxicology in the Middle Ages and Renaissance +Discovery and Development of Neuroprotective Agents From Natural Products +History of Immunotoxicology +Nanotechnology-Based Approaches for Targeting and Delivery of Drugs and Genes +Drug Discovery and Development +Fundamentals of Toxicologic Pathology +Principal Aspects of Qualitative and Quantitative Bioanalysis by LC-MS +Risk Management of Complex Inorganic Materials +Serum Pharmacochemistry of Traditional Chinese Medicine +Principles and Practice of Clinical Research +Emerging Nanotechnologies for Diagnostics, Drug Delivery and Medical Devices +Supercooling, crystallization and melting within emulsions and divided systems: mass, heat transfers and stability +ISTE topics in Physics +Neutron Scattering – Applications in Chemistry, Materials Science and Biology +Fundamentals of Quantum Mechanics +Phononics +Special Relativity +Advances in Semiconductor Nanostructures +Introduction to Magnetic Reconnection in Plasmas +The Classical Stefan Problem +Linear Ray and Wave Optics in Phase Space +Global Neutron Calculations +Laminar Drag Reduction +Effects of Military Service on Well-Being +Children's Thinking +Autism and Autism Spectrum Disorders on the Rise? +Self-Preservation at the Core of the Personality +Conducting Independent Educational Evaluations +The General Factor of Personality +Personality in Aviation +Understanding Emotions in Mathematical Thinking and Learning +Consumer Neuroscience +Reconstructing Meaning After Trauma +The Science of Cognitive Behavioral Therapy +Executive Functions in Health and Disease +Innovative Approaches to Individual and Community Resilience +The Psychology of Gender and Health +Twin Mythconceptions +Creativity and the Performing Artist +Digitally Constructed Realities +Systems Factorial Technology +Rationality +Personality Development Across the Lifespan +Acquisition of Complex Arithmetic Skills and Higher-Order Mathematics Concepts +Anxiety in Children and Adolescents with Autism Spectrum Disorder +Dominance and Aggression in Humans and Other Animals +Journeys of Embodiment at the Intersection of Body and Culture +Suicide Patterns and Motivations +Quality Activities in Center-Based Programs for Adults with Autism +Cognitive Function and the Pleasure of Music +Practical Guide to Finding Treatments that Work for People with Autism +The Creative Self +Teaching Executive Functioning Skills to Individuals with Autism Spectrum Disorder +Pediatric Disorders of Regulation in Affect and Behavior +Brain-Based Learning and Education +Handbook of Key Topics in Research Management and Administration +The Diaoyu/Senkaku Islands +Unplugging the Classroom +Interpreting Japan's Contested Memory +Positivity and Spirituality in the Information Organization +Intangible Organisational Resources in Libraries +Capital Market Integration in South Asia +Liner Ship Fleet Planning +Modeling of Transport Demand +Port Cybersecurity +Resource Sharing as a Process +Are We Safe Enough? Measuring and Assessing Aviation Security +Media and Information Literacy +XML-based Content Management +Digital Inclusion and Exclusion +Scholarly Communication at the Crossroads in China +The Political Economy of Business Ethics in East Asia +Marketing Services and Resources in Information Organizations +Internationalisation and Managing Networks in the Asia Pacific +Enterprise Content Management, Records Management and Information Culture Amidst E-Government Development +Transliteracy in Complex Information Environments +The Road to Active Thinking +Academic Crowdsourcing in the Humanities +Organizational Learning in Asia +The Art of Teaching Online +Seven Leadership Principles of Chinese Women in Business Leaders +The Changing Face of Corruption in the Asia Pacific +Successful Fundraising for the Academic Library +Innovation in Public Libraries +Strategic Management of Libraries +The Crosswalk +Beyond Mentoring +Social Media in the Marketing Context +Social Justice and Librarianship +The 21st Century Academic Library +Research Made Accessible +Ethic Management in Libraries and other Information Services +International Librarianship At Home and Abroad +Data Analytics for Intelligent Transportation Systems +Urban Mobility +Measuring Road Safety with Surrogate Event +The Psychology of the Car +Vulnerability Analysis for Transportation Networks +Document Management at the Heart of Business Processes: +Digital interculturality +Knowledge Audits and Knowledge Mapping +Utilizing Technology in the Academic Research Process +Academic Librarianship, Publishing, and the Tenure Track +Providing Research Support +The Librarian's Guide to Catholic Resources on the Internet +Reinventing Librarianship +Boosting the Knowledge Economy +Information Architecture http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/pom.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/pom.xml b/distribution/src/main/release/samples/pom.xml index f90aad6..5e31d58 100644 --- a/distribution/src/main/release/samples/pom.xml +++ b/distribution/src/main/release/samples/pom.xml @@ -125,6 +125,7 @@ jax_rs/sse_cdi jax_rs/sse_tomcat jax_rs/sse_spring + jax_rs/nio_cdi http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java ---------------------------------------------------------------------- diff --git a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java index 97d8e0c..3e9031e 100644 --- a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java +++ b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java @@ -344,7 +344,7 @@ public class JAXRSCdiResourceExtension implements Extension { (JAXRSServerFactoryCustomizationExtension)beanManager.getReference( extensionBean, extensionBean.getBeanClass(), - beanManager.createCreationalContext(extensionBean) + createCreationalContext(beanManager, extensionBean) ); extension.customize(bean); } http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java index 29c5c42..e0f98da 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java @@ -41,6 +41,7 @@ import javax.ws.rs.core.Response.ResponseBuilder; import javax.ws.rs.core.UriInfo; import javax.ws.rs.core.Variant; +import org.apache.cxf.jaxrs.nio.NioWriteEntity; import org.apache.cxf.message.Message; import org.apache.cxf.phase.PhaseInterceptorChain; @@ -318,14 +319,14 @@ public class ResponseBuilderImpl extends ResponseBuilder implements Cloneable { } @Override - public ResponseBuilder entity(NioWriterHandler arg0) { - // TODO: Not Implemented - return this; + public ResponseBuilder entity(NioWriterHandler writer) { + return entity(writer, (throwable) -> { + }); } @Override - public ResponseBuilder entity(NioWriterHandler arg0, NioErrorHandler arg1) { - // TODO: Not Implemented + public ResponseBuilder entity(NioWriterHandler writer, NioErrorHandler error) { + this.entity = new NioWriteEntity(writer, error); return this; } } http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioOutputStream.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioOutputStream.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioOutputStream.java new file mode 100644 index 0000000..29e05e1 --- /dev/null +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioOutputStream.java @@ -0,0 +1,57 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.jaxrs.nio; + +import java.io.IOException; +import java.io.OutputStream; + +import javax.ws.rs.core.NioOutputStream; + +public class DelegatingNioOutputStream extends NioOutputStream { + private final OutputStream out; + + public DelegatingNioOutputStream(final OutputStream out) { + this.out = out; + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + out.write(b, off, len); + } + + @Override + public void write(byte[] b) throws IOException { + out.write(b); + } + + @Override + public void write(int b) throws IOException { + out.write(b); + } + + @Override + public void flush() throws IOException { + out.flush(); + } + + @Override + public void close() throws IOException { + out.close(); + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioServletOutputStream.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioServletOutputStream.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioServletOutputStream.java new file mode 100644 index 0000000..682d5a4 --- /dev/null +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioServletOutputStream.java @@ -0,0 +1,61 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.jaxrs.nio; + +import java.io.IOException; + +import javax.servlet.ServletOutputStream; +import javax.ws.rs.core.NioOutputStream; + +public class DelegatingNioServletOutputStream extends NioOutputStream { + private final ServletOutputStream out; + + public DelegatingNioServletOutputStream(final ServletOutputStream out) { + this.out = out; + } + + @Override + public void write(byte[] b) throws IOException { + out.write(b); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + out.write(b, off, len); + } + + @Override + public void write(int b) throws IOException { + out.write(b); + } + + @Override + public void flush() throws IOException { + out.flush(); + } + + @Override + public void close() throws IOException { + out.close(); + } + + public boolean isReady() { + return out.isReady(); + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioFeature.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioFeature.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioFeature.java new file mode 100644 index 0000000..56d4664 --- /dev/null +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioFeature.java @@ -0,0 +1,40 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.jaxrs.nio; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.cxf.Bus; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.feature.AbstractFeature; +import org.apache.cxf.jaxrs.provider.ServerProviderFactory; + +public class NioFeature extends AbstractFeature { + @Override + public void initialize(Server server, Bus bus) { + final List providers = new ArrayList<>(); + providers.add(new NioMessageBodyWriter()); + + server.getEndpoint().getInInterceptors().add(new NioInInterceptor()); + ((ServerProviderFactory)server.getEndpoint() + .get(ServerProviderFactory.class.getName())) + .setUserProviders(providers); + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioInInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioInInterceptor.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioInInterceptor.java new file mode 100644 index 0000000..de97a19 --- /dev/null +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioInInterceptor.java @@ -0,0 +1,91 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.jaxrs.nio; + +import java.util.List; + +import javax.ws.rs.core.Response; + +import org.apache.cxf.continuations.Continuation; +import org.apache.cxf.continuations.ContinuationCallback; +import org.apache.cxf.continuations.ContinuationProvider; +import org.apache.cxf.interceptor.Fault; +import org.apache.cxf.interceptor.ServiceInvokerInterceptor; +import org.apache.cxf.message.Exchange; +import org.apache.cxf.message.Message; +import org.apache.cxf.phase.AbstractPhaseInterceptor; +import org.apache.cxf.phase.Phase; + +public class NioInInterceptor extends AbstractPhaseInterceptor { + public NioInInterceptor() { + super(Phase.INVOKE); + addAfter(ServiceInvokerInterceptor.class.getName()); + } + + public void handleMessage(Message message) throws Fault { + final Exchange exchange = message.getExchange(); + if (exchange.isOneWay()) { + return; + } + + if (exchange.getOutMessage() != null) { + final Message out = exchange.getOutMessage(); + + Object result = out.getContent(Object.class); + if (result == null) { + result = out.getContent(List.class); + if (result != null) { + final List results = (List)result; + if (!results.isEmpty()) { + result = results.get(0); + } + } + } + + Object entity = result; + if (result instanceof Response) { + entity = ((Response)result).getEntity(); + } + + if (entity instanceof NioWriteEntity) { + message.getExchange().put(ContinuationCallback.class, new ContinuationCallback() { + @Override + public void onError(Throwable error) { + System.out.println("onError()"); + } + + @Override + public void onDisconnect() { + System.out.println("onDisconnect()"); + } + + @Override + public void onComplete() { + System.out.println("onComplete()"); + } + }); + + + final ContinuationProvider provider = message.get(ContinuationProvider.class); + final Continuation continuation = provider.getContinuation(); + continuation.suspend(0); + } + } + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioMessageBodyWriter.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioMessageBodyWriter.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioMessageBodyWriter.java new file mode 100644 index 0000000..9a70085 --- /dev/null +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioMessageBodyWriter.java @@ -0,0 +1,97 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.jaxrs.nio; + +import java.io.IOException; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + +import javax.servlet.ServletOutputStream; +import javax.servlet.WriteListener; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.ext.MessageBodyWriter; +import javax.ws.rs.ext.Provider; + +import org.apache.cxf.transport.http.AbstractHTTPDestination.WrappingOutputStream; + +@Provider +public class NioMessageBodyWriter implements MessageBodyWriter { + @Context + private HttpServletRequest request; + + public NioMessageBodyWriter() { + } + + @Override + public boolean isWriteable(Class cls, Type type, Annotation[] anns, MediaType mt) { + return NioWriteEntity.class.isAssignableFrom(cls); + } + + @Override + public void writeTo(NioWriteEntity p, Class cls, Type t, Annotation[] anns, + MediaType mt, MultivaluedMap headers, OutputStream os) + throws IOException, WebApplicationException { + + OutputStream out = os; + if (out instanceof WrappingOutputStream) { + final WrappingOutputStream wrappingStream = (WrappingOutputStream)out; + if (wrappingStream.getWrappingOutputStream() != null) { + out = wrappingStream.getWrappingOutputStream(); + } + } + + if (out instanceof ServletOutputStream) { + final ServletOutputStream servletOutputStream = (ServletOutputStream)out; + + if (!request.isAsyncStarted()) { + request.startAsync(); + } + + final WriteListener listener = new NioWriterImpl(p.getWriter(), p.getError(), + request.getAsyncContext(), servletOutputStream); + servletOutputStream.setWriteListener(listener); + } else { + final DelegatingNioOutputStream nio = new DelegatingNioOutputStream(out); + try { + while (p.getWriter().write(nio)) { + Thread.yield(); + } + } catch (Throwable ex) { + try { + p.getError().error(ex); + } catch (IOException | WebApplicationException inner) { + throw inner; + } catch (Throwable inner) { + throw new WebApplicationException(ex); + } + } + } + } + + @Override + public long getSize(NioWriteEntity t, Class type, Type genericType, Annotation[] annotations, + MediaType mediaType) { + return -1; + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriteEntity.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriteEntity.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriteEntity.java new file mode 100644 index 0000000..cdd3410 --- /dev/null +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriteEntity.java @@ -0,0 +1,40 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.jaxrs.nio; + +import javax.ws.rs.core.NioErrorHandler; +import javax.ws.rs.core.NioWriterHandler; + +public final class NioWriteEntity { + private final NioWriterHandler writer; + private final NioErrorHandler error; + + public NioWriteEntity(final NioWriterHandler writer, final NioErrorHandler error) { + this.writer = writer; + this.error = error; + } + + public NioWriterHandler getWriter() { + return writer; + } + + public NioErrorHandler getError() { + return error; + } +}